linClubs / BEVFusion-ROS-TensorRT

BEVFusion-ROS-TensorRT-CPP real time inference including ros1 & ros2.
BSD 3-Clause "New" or "Revised" License
113 stars 23 forks source link

/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference to `TIFFReadDirectory@LIBTIFF_4.0' #9

Open OrangeJuice3211 opened 3 months ago

OrangeJuice3211 commented 3 months ago

我在使用catkin_make命令编译时,总是报这种错误:

/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference to TIFFReadDirectory@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFLastDirectory@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference to TIFFWriteEncodedStrip@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference toTIFFIsTiled@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFIsByteSwapped@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFFlushData@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFFreeDirectory@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference toTIFFScanlineSize@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFWriteEncodedTile@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFWriteBufferSetup@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFTileSize@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference toTIFFRGBAImageOK@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference to TIFFClose@LIBTIFF_4.0' /usr/bin/ld: /lib/x86_64-linux-gnu/libfontconfig.so.1: undefined reference touuid_copy@UUID_1.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFWriteRawStrip@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFSetTagExtender@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFGetFieldDefaulted@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFReadRGBATileExt@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFStripSize@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFMergeFieldInfo@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference to TIFFSetWarningHandler@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFGetConfiguredCODECs@LIBTIFF_4.0' /usr/bin/ld: /lib/x86_64-linux-gnu/libgeotiff.so.5: undefined reference to _TIFFmalloc@LIBTIFF_4.0' /usr/bin/ld: /lib/x86_64-linux-gnu/libgeotiff.so.5: undefined reference to_TIFFmemcpy@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFClientdata@LIBTIFF_4.0' /usr/bin/ld: /lib/x86_64-linux-gnu/libgeotiff.so.5: undefined reference to_TIFFrealloc@LIBTIFF_4.0' /usr/bin/ld: /lib/x86_64-linux-gnu/libgeotiff.so.5: undefined reference to _TIFFmemset@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFReadRGBAStripExt@LIBTIFF_4.0' /usr/bin/ld: /lib/x86_64-linux-gnu/libfontconfig.so.1: undefined reference to uuid_generate_random@UUID_1.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFWriteCheck@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFSetWriteOffset@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFDefaultStripSize@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFIsBigEndian@LIBTIFF_4.0' /usr/bin/ld: /lib/x86_64-linux-gnu/libpoppler.so.97: undefined reference toTIFFFdOpen@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference to TIFFWriteScanline@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to_TIFFfree@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference to TIFFGetField@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFNumberOfStrips@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference to TIFFWriteDirectory@LIBTIFF_4.0' /usr/bin/ld: /lib/x86_64-linux-gnu/libgdcmMSFF.so.3.0: undefined reference touuid_generate@UUID_1.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference to TIFFReadEncodedTile@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference toTIFFReadRGBATile@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference to TIFFClientOpen@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFFlush@LIBTIFF_4.0' /usr/bin/ld: /lib/x86_64-linux-gnu/libgdcmMSFF.so.3.0: undefined reference to uuid_parse@UUID_1.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFErrorExt@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFNumberOfDirectories@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFWriteRawTile@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFCreateDirectory@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference toTIFFOpen@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFSetSubDirectory@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFUnlinkDirectory@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference to TIFFReadEncodedStrip@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference toTIFFSetField@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFCurrentDirOffset@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFIsCODECConfigured@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFUnsetField@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFDataWidth@LIBTIFF_4.0' /usr/bin/ld: /lib/x86_64-linux-gnu/libgdcmMSFF.so.3.0: undefined reference to uuid_unparse@UUID_1.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFRewriteDirectory@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFGetSizeProc@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference toTIFFSetErrorHandler@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFSetDirectory@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference toTIFFReadScanline@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFNumberOfTiles@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference toTIFFReadRGBAStrip@LIBTIFF_4.0' collect2: error: ld returned 1 exit status make[2]: [BEVFusion-ROS-TensorRT/CMakeFiles/bevfusion_node.dir/build.make:1107:/home/dell/OrangeWS/bevfusion_ws/devel/lib/bevfusion/bevfusion_node] 错误 1 make[1]: [CMakeFiles/Makefile2:483:BEVFusion-ROS-TensorRT/CMakeFiles/bevfusion_node.dir/all] 错误 2`

搜到的有人说是libtiff版本的问题,需要4.0版本,而系统上没有。我手动下载了4.0的版本,并且使用 ldd /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0查到libtiff依赖为libtiff.so.5,并将其指向新下载的libtiff.so.5.4.0(原指向为libtiff.so.5.5.0),依然没用。参考用到的链接如下:

https://blog.csdn.net/qq_39779233/article/details/127718188 https://blog.csdn.net/jiaken2660/article/details/117036606

问题依然无法解决,请问大家这个需要特定的opencv版本吗?这个问题如何解决呢?

linClubs commented 2 months ago

我是用的opencv-4.2版本