Use ros-indigo-opencv3 alongside 2.4.8?
Maybe it is brand new but I've recently noticed I can install ros-indigo-opencv3. It installs into the /opt/ros/indigo. There is also a opencv 2.4.8 already installed into the system outside of /opt in /usr/lib/x86_64-linux-gnu/, and every ros package from the repositories linked against opencv is linked to that.
When I try to build a package that depends on cv_bridge it fails:
CMakeFiles/rotate_cam.dir/src/rotate_cam.cpp.o: In function `RotateImage::RotateImage()':
rotate_cam.cpp:(.text+0x6dc): undefined reference to `cv::imread(cv::String const&, int)'
CMakeFiles/rotate_cam.dir/src/rotate_cam.cpp.o: In function `cv::String::~String()':
rotate_cam.cpp:(.text._ZN2cv6StringD2Ev[_ZN2cv6StringD5Ev]+0x14): undefined reference to `cv::String::deallocate()'
CMakeFiles/rotate_cam.dir/src/rotate_cam.cpp.o: In function `cv::String::String(std::string const&)':
rotate_cam.cpp:(.text._ZN2cv6StringC2ERKSs[_ZN2cv6StringC5ERKSs]+0x69): undefined reference to `cv::String::allocate(unsigned long)'
And if I remove ros-indigo-opencv3 it builds fine. With VERBOSE=1 I don't see any trace of opencv3 includes or libraries (cv_bridge properly brings in 2.4.8 libraries, and includes /usr/include/opencv which is still 2.4.8).
The problem is that it is using opencv 3.0 headers and linking against 2.4.8, and breakage between those produces the link error.
When the a node dependent on opencv 2.4.8 builds it runs:
c++ ... -I/opt/ros/jade/include -I/usr/include/opencv ...
It seem like one problem is that opencv 3.0 is installed in the jade directories and 2.4.8 is in the usr directory- so it is using the wrong header files. But even when I correct this ordering the linker error still occurs.
What I'd like is to have opencv 3.0 available for special packages that need it (though they can't also link to cv_bridge, no mixing of 2.4.8 and 3.0 in the same package?).
I'm going to try to duplicate this problem on a small scale, it is possibly an artifact of something in one of my cmake files in my large workspace.
Ubuntu 14.04.2
Any update on this? I working on a project with similar concerns.
Tried this with ros-jade-opencv3.0 and it fails the same way.
See https://github.com/ros-perception/vis...
@jeremya I was able to get opencv 3.0 installed from source to a non-standard location and have a specific package find_package it. ros-indigo-opencv3 seems just plain broken. http://answers.ros.org/question/21392...