Reference errors after opencv3 installation [closed]
Hi, I had earlier my Ros-Indigo running with the visensor_node stereo camera. It all worked well with the old opencv I had on my pc. But since I installed opencv 3 in usr/lib the following errors occur. Need help. I'm relatively new to ROS.
Linking CXX executable /home/andy/catkin_ws/devel/lib/stereo_proc/stereo_proc_node
CMakeFiles/stereo_proc_node.dir/src/stereo_proc_node.cpp.o: In function `SSD(cv::Mat, cv::Mat, unsigned int, cv::Mat)':
stereo_proc_node.cpp:(.text+0xfd): undefined reference to `cv::imshow(cv::String const&, cv::_InputArray const&)'
CMakeFiles/stereo_proc_node.dir/src/stereo_proc_node.cpp.o: In function `Correspondence(cv::Mat&, cv::Mat&, unsigned int)':
stereo_proc_node.cpp:(.text+0x4fd): undefined reference to `cv::StereoBM::create(int, int)'
stereo_proc_node.cpp:(.text+0x6ac): undefined reference to `cv::namedWindow(cv::String const&, int)'
stereo_proc_node.cpp:(.text+0x701): undefined reference to `cv::imshow(cv::String const&, cv::_InputArray const&)'
CMakeFiles/stereo_proc_node.dir/src/stereo_proc_node.cpp.o: In function `Process(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&, boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&, image_transport::Publisher&, image_transport::Publisher&)':
stereo_proc_node.cpp:(.text+0xbdb): undefined reference to `cv::imshow(cv::String const&, cv::_InputArray const&)'
stereo_proc_node.cpp:(.text+0xc4d): undefined reference to `cv::imshow(cv::String const&, cv::_InputArray const&)'
CMakeFiles/stereo_proc_node.dir/src/stereo_proc_node.cpp.o: In function `main':
stereo_proc_node.cpp:(.text+0x11a1): undefined reference to `cv::namedWindow(cv::String const&, int)'
stereo_proc_node.cpp:(.text+0x11d8): undefined reference to `cv::namedWindow(cv::String const&, int)'
CMakeFiles/stereo_proc_node.dir/src/stereo_proc_node.cpp.o: In function `cv::String::String(char const*)':
stereo_proc_node.cpp:(.text._ZN2cv6StringC2EPKc[_ZN2cv6StringC5EPKc]+0x4f): undefined reference to `cv::String::allocate(unsigned long)'
CMakeFiles/stereo_proc_node.dir/src/stereo_proc_node.cpp.o: In function `cv::String::~String()':
stereo_proc_node.cpp:(.text._ZN2cv6StringD2Ev[_ZN2cv6StringD5Ev]+0x14): undefined reference to `cv::String::deallocate()'
CMakeFiles/stereo_proc_node.dir/src/stereo_proc_node.cpp.o: In function `cv::String::String(std::string const&)':
stereo_proc_node.cpp:(.text._ZN2cv6StringC2ERKSs[_ZN2cv6StringC5ERKSs]+0x69): undefined reference to `cv::String::allocate(unsigned long)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/andy/catkin_ws/devel/lib/stereo_proc/stereo_proc_node] Error 1
make[1]: *** [stereo_proc/CMakeFiles/stereo_proc_node.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Linking CXX executable /home/andy/catkin_ws/devel/lib/visensor_node/visensor_node
CMakeFiles/visensor_node.dir/src/visensor.cpp.o: In function `cv::String::String(char const*)':
visensor.cpp:(.text._ZN2cv6StringC2EPKc[_ZN2cv6StringC5EPKc]+0x4f): undefined reference to `cv::String::allocate(unsigned long)'
CMakeFiles/visensor_node.dir/src/visensor.cpp.o: In function `cv::String::~String()':
visensor.cpp:(.text._ZN2cv6StringD2Ev[_ZN2cv6StringD5Ev]+0x14): undefined reference to `cv::String::deallocate()'
CMakeFiles/visensor_node.dir/src/visensor.cpp.o: In function `cv::Mat::Mat(int, int, int, void*, unsigned long)':
visensor.cpp:(.text._ZN2cv3MatC2EiiiPvm[_ZN2cv3MatC5EiiiPvm]+0x1b5): undefined reference to `cv::error(int, cv::String const&, char const*, char const*, int)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/andy/catkin_ws/devel/lib/visensor_node/visensor_node] Error 1
make[1]: *** [visensor_node/CMakeFiles/visensor_node.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j4 -l4" failed
I managed to get rid of most errors by just deleting the build and devel folders in catkin_ws and rebuilding the whole package. But now I'm getting a segmentation fault in my code because my new libopencv3 and 2.4.8 are somehow not compatible.
Duplicate of http://answers.ros.org/question/21404...