kinetic版本ros安装find_object_2d编译报错libopencv_imgcodecs3.so.3.3.1:对‘TIFFReadRGBAStrip@LIBTIFF_4.0’

Ubuntu16.04、kinetic版本在ros中下载安装find_object_2d的包,编译时报错

主要的原因是我系统上安装的是opencv3.4.4的版本,ros自带的是opencv3.3.1,应该有了版本冲突:

opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFReadRGBAStrip@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFReadDirectory@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFWriteEncodedStrip@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFIsTiled@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFWriteScanline@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFGetField@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFNumberOfStrips@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFScanlineSize@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFReadEncodedTile@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFReadRGBATile@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFClose@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFClientOpen@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFRGBAImageOK@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFOpen@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFReadEncodedStrip@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFSetField@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFSetWarningHandler@LIBTIFF_4.0’未定义的引用
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1:对‘TIFFSetErrorHandler@LIBTIFF_4.0’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/viso2.dir/build.make:262: recipe for target 'viso2' failed
make[2]: *** [viso2] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/viso2.dir/all' failed
make[1]: *** [CMakeFiles/viso2.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

网上的很多方法是针对使用opencv和cv_bridge时的CmakeList.txt文件中将链接库中加上

/usr/lib/x86_64-linux-gnu/libtiff.so.5的路径,

但是下载包find_object_2d的CmakeList.txt文件中并没有像编译代码那样的链接库,尝试了许多方法最后的解决方法:

在find_object_2d包内的CmakeList.txt文件中,将FIND_PACKAGE(OpenCV  REQUIRED)强加上指定版本FIND_PACKAGE(OpenCV 3.3.1 REQUIRED)

然后保存再编译,问题解决

kinetic版本ros安装find_object_2d编译报错libopencv_imgcodecs3.so.3.3.1:对‘TIFFReadRGBAStrip@LIBTIFF_4.0’_第1张图片

 

你可能感兴趣的:(ROS学习,Ros视觉)