Problem when compiling OpenCV with ROS
I am using rosbuild to build a project with OpenCV and ROS. The OpenCV version is 2.4.9, built and installed from source. The ROS version is indigo.
When I include the nonfree module of OpenCV (has SIFT and SURF) in my project files, I got a linking error something like"libopencv.so.2.4.9: undefined reference to ocl::integral()" after I build the ROS package using the CMakeList.txt.
I noticed that the compilation information in the terminal shows the compiler is also trying to link to some existing OpenCV 2.4.8 libs in the directory /lib/x86_64-linux-gnu/libgopencv*.so.2.4.8.
I realized that the OpenCV 2.4.8 might come with the CV_Bridge package when I install it. It seems the cmake is trying to link to some libs of 2.4.8 and also 2.4.9, which leads to some undefined reference. Another observation is that without ROS, I am able to compile a project with OpenCV (using pkg-config).
It seems the problem is the co-existence of two versions of OpenCV. How can I make it only link to the version I choose? I used find_package in the CMakeList file, but the compiler always tries to link to both version.
Thanks you very much. Rui
Just to make sure: are you really using
rosbuild
orcatkin
?I am using rosbuild.
Hi, I have the same problem when I use the nonfree module in ROS Indigo, have you found a solution for this error?