Rosanswers logo


I'm trying to compile ccny_vision/ar_pose and other packages that require opencv, on my amd64 Debian system. I have compiled and installed the latest stable opencv release via svn. I've tinkered with CMakeLists.txt and manifest.xml of the packages I've been trying to compile, and looked through a bunch of other files. But in the end I still get an error of this type:

mkdir -p bin cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=rospack find rosbuild/rostoolchain.cmake ..
[rosbuild] Building package cv_bridge [rosbuild] Cached build flags older than manifests; calling rospack to get flags Failed to invoke /home/joris/ros/ros/bin/rospack cflags-only-I;--deps-only cv_bridge
Package opencv-2.3.1 was not found in the pkg-config search path. Perhaps you should add the directory containing opencv-2.3.1.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv-2.3.1' found [rospack] warning: got non-zero exit status from executing backquote expression "ret="pkg-config opencv-2.3.1 --cflags`" && echo $ret" in [/home/joris/ros/vision_opencv/opencv2/manifest.xml] [rospack] error in backquote expansion for cv_bridge

Any help would be appreciated. Perhaps A simple howto about how to find and include OpenCV from ROS packages (including non electric-updated ones) for people like me who aren't familiar with the ROS / cmake linking process, would be a good idea too...


Originally posted by Joris on ROS Answers with karma: 68 on 2011-09-28

Post score: 0

Original comments

Comment by Bram van de Klundert on 2011-09-29:
you should probably take a look at the opencv package: http://www.ros.org/wiki/opencv2


1 Answer 1


Rosanswers logo

Ok, so I have worked my way around this issue, and although I have come to an interim conclusion about this (more below) I do not think that I have a definitive answer to my question that puts the problem into perspective...

It seems to me that "rosdep install" (or the "--rosdep-install" option for rosmake) should not be relied upon if your system is ``experimental'' - e.g. Debian or Ubuntu armel.

You may be lucky and the scripts may resolve dependencies into the correct packages for your system, where they exist.

But if you get a dependency error from rosdep and you're on an "experimental" system, abandon "--rosdep-install", build the libraries/packages you need from source or install from backports, and try building your ROS package again using rosmake, leaving out the rosdep step/option. Ignore warnings (for the moment, at least), and if your package installs without errors, you should be set. If you get errors about dependencies that you are sure you built and/or installed, then I have one more silverish bullet, which is to ensure the ".pc" file for your library/package is in the pkg-config path with .pc files (in my case, "/usr/local/lib/pgkconfig/").

Sometimes the ROS package might be looking for a particular .pc filename, like "opencv-2.3.pc", when your build of opencv 2.3 only placed a "opencv.pc" file there. Then, my solution is to create a symbolic link, in this case from "opencv.pc" to "opencv-2.3.pc" in the relevant pkgconfig path.

Hope this helps someone!

Originally posted by Joris with karma: 68 on 2011-10-02

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by joq on 2012-04-17:
Naturally, experimental systems are less well-integrated. But don't over-generalize. There are OSX users actively working to fix broken rosdep issues as they find them. The approach you recommend does nothing to make ROS work better on Debian.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.