报错信息
问题一:
/usr/bin/ld: /lib/x86_64-linux-gnu/libp11-kit.so.0: undefined reference to ffi_closure_alloc@LIBFFI_CLOSURE_7.0' /usr/bin/ld: /lib/x86_64-linux-gnu/libp11-kit.so.0: undefined reference to ffi_prep_closure_loc@LIBFFI_CLOSURE_7.0'
/usr/bin/ld: /lib/x86_64-linux-gnu/libp11-kit.so.0: undefined reference to ffi_type_uint8@LIBFFI_BASE_7.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFReadRGBATileExt@LIBTIFF_4.0'
/usr/bin/ld: /lib/x86_64-linux-gnu/libwayland-client.so.0: undefined reference to ffi_type_void@LIBFFI_BASE_7.0' /usr/bin/ld: /lib/x86_64-linux-gnu/libwayland-client.so.0: undefined reference to ffi_prep_cif@LIBFFI_BASE_7.0'
/usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFReadRGBAStripExt@LIBTIFF_4.0' /usr/bin/ld: /lib/x86_64-linux-gnu/libwayland-client.so.0: undefined reference to ffi_type_uint32@LIBFFI_BASE_7.0'
/usr/bin/ld: /lib/x86_64-linux-gnu/libwayland-client.so.0: undefined reference to ffi_type_sint32@LIBFFI_BASE_7.0' /usr/bin/ld: /lib/x86_64-linux-gnu/libwayland-client.so.0: undefined reference to ffi_call@LIBFFI_BASE_7.0'
/usr/bin/ld: /lib/x86_64-linux-gnu/libwayland-client.so.0: undefined reference to ffi_type_pointer@LIBFFI_BASE_7.0' /usr/bin/ld: /lib/x86_64-linux-gnu/libp11-kit.so.0: undefined reference to ffi_type_uint64@LIBFFI_BASE_7.0'
问题二:
/usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFReadRGBATileExt@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to TIFFReadRGBAStripExt@LIBTIFF_4.0'
问题描述
在复现TextSLAM的过程中,遇到的ffi库和gdal库报undefined reference的错
解决方法
1. 修改CMakeLists
在TARGET_LINK_LIBRARIES最后加入-lffi -lgdal
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${CERES_LIBRARIES} ${OpenCV_LIBS} ${QT_LIBRARIES} ${Sophus_LIBRARIES}
${EIGEN3_LIBS} -lffi -lgdal)
参考:https://forum.freecad.org/viewtopic.php?style=2&t=75527
https://forum.freecad.org/viewtopic.php?style=2&t=75527
2. 针对gdal库仍找不到的问题,将tiff改为tiff-4.0 版本
过程参考:https://blog.csdn.net/qq_39779233/article/details/127718188