current position:Home>Encountered /usr/bin/ld: cannot find -lvtkxxx problem when compiling DBOW library on jetson xavier

Encountered /usr/bin/ld: cannot find -lvtkxxx problem when compiling DBOW library on jetson xavier

2022-11-24 22:51:33I am a happy little party dish

Recently in theORB-SLAM3的代码从amdThe architecture's devices are deployed to NVIDIA'sjetson xavier上,Compiling third-party librariesDBoW2遇到一个问题/usr/bin/ld: cannot find -lvtkxxx,要给xaviergoing to kneel

解决办法直接看2解决办法

1问题描述:

[ 14%] Linking CXX shared library ../lib/libDBoW2.so
/usr/bin/ld: cannot find -lvtkRenderingOpenGL
/usr/bin/ld: cannot find -lvtkImagingHybrid
/usr/bin/ld: cannot find -lvtkIOImage
/usr/bin/ld: cannot find -lvtkCommonDataModel
/usr/bin/ld: cannot find -lvtkCommonMath
/usr/bin/ld: cannot find -lvtkCommonCore
/usr/bin/ld: cannot find -lvtksys
/usr/bin/ld: cannot find -lvtkCommonMisc
/usr/bin/ld: cannot find -lvtkCommonSystem
/usr/bin/ld: cannot find -lvtkCommonTransforms
/usr/bin/ld: cannot find -lvtkCommonExecutionModel
/usr/bin/ld: cannot find -lvtkDICOMParser
/usr/bin/ld: cannot find -lvtkIOCore
/usr/bin/ld: cannot find -lvtkmetaio
/usr/bin/ld: cannot find -lvtkImagingCore
/usr/bin/ld: cannot find -lvtkRenderingCore
/usr/bin/ld: cannot find -lvtkCommonColor
/usr/bin/ld: cannot find -lvtkFiltersExtraction
/usr/bin/ld: cannot find -lvtkFiltersCore
/usr/bin/ld: cannot find -lvtkFiltersGeneral
/usr/bin/ld: cannot find -lvtkCommonComputationalGeometry
/usr/bin/ld: cannot find -lvtkFiltersStatistics
/usr/bin/ld: cannot find -lvtkImagingFourier
/usr/bin/ld: cannot find -lvtkalglib
/usr/bin/ld: cannot find -lvtkFiltersGeometry
/usr/bin/ld: cannot find -lvtkFiltersSources
/usr/bin/ld: cannot find -lvtkInteractionStyle
/usr/bin/ld: cannot find -lvtkRenderingLOD
/usr/bin/ld: cannot find -lvtkFiltersModeling
/usr/bin/ld: cannot find -lvtkIOPLY
/usr/bin/ld: cannot find -lvtkIOGeometry
/usr/bin/ld: cannot find -lvtkFiltersTexture
/usr/bin/ld: cannot find -lvtkRenderingFreeType
/usr/bin/ld: cannot find -lvtkftgl
/usr/bin/ld: cannot find -lvtkIOExport
/usr/bin/ld: cannot find -lvtkRenderingAnnotation
/usr/bin/ld: cannot find -lvtkImagingColor
/usr/bin/ld: cannot find -lvtkRenderingContext2D
/usr/bin/ld: cannot find -lvtkRenderingGL2PS
/usr/bin/ld: cannot find -lvtkRenderingContextOpenGL
/usr/bin/ld: cannot find -lvtkRenderingLabel
collect2: error: ld returned 1 exit status
CMakeFiles/DBoW2.dir/build.make:285: recipe for target '../lib/libDBoW2.so' failed
make[2]: *** [../lib/libDBoW2.so] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/DBoW2.dir/all' failed
make[1]: *** [CMakeFiles/DBoW2.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

All in all it's forDBOW2Could not find when linking external library filevtk相关的内容,使用find /usr/lib -name libvtk*进行查找,Found that there are also related library files,只不过是在/usr/lib/aarch64-linux-gnu/目录下

尝试失败1:
CMakeLists.txtAdd the path to the library file addressLINK_DIRECTORIES(/lib/aarch64-linux-gnu)
尝试失败2:
Import the relevant library from /usr/lib/aarch64-linux-gnu/直接拷贝到/usr/lib目录下
尝试失败3:
/usr/lib/cmake/vtk-6.3目录下的.cmake拷贝到DBOW2目录下

2解决办法

Saw a similar error,见链接,I think of when I was searching for related library files before,库文件的名称是libvtkRenderingCore-6.3.so,带有版本信息.

Then follow the method in the blog,新建一个libvtkRenderingCore.so的软连接,Make it link to what you already havelibvtkRenderingCore-6.3.so,Perform corresponding operations on the library files indicated in the error report,重新编译,没有报错.

完整命令:

cd /usr/lib/aarch64-linux-gnu/
sudo ln -slibvtkRenderingCore-6.3.so libvtkRenderingCore.so

但是存在一个小问题,If we just one or two libraries can't be found,It is easier to solve it using the above method,But probably like me20个库,It feels so stupid to do it over and over again,,,,,,Looking forward to a one-step approach

copyright notice
author[I am a happy little party dish],Please bring the original link to reprint, thank you.
https://en.chowdera.com/2022/328/202211242242405642.html

Random recommended