Ask Your Question
0

Reference errors after opencv3 installation [closed]

asked 2015-10-21 16:02:08 -0500

lamparta gravatar image

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
edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by lucasw
close date 2015-11-30 16:26:03.742359

Comments

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.

lamparta gravatar imagelamparta ( 2015-10-21 16:38:57 -0500 )edit
lucasw gravatar imagelucasw ( 2015-11-30 16:25:12 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-10-28 05:24:30 -0500

lamparta gravatar image

I solved it by deleting all the new opencv3 libraries on the system, removing ros-indigo-opencv3 and working with 2.4.8 again. Another way would be to build cv_bridge and image_transport against opencv3.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2015-10-21 16:02:08 -0500

Seen: 4,262 times

Last updated: Oct 28 '15