【已解决】libboost_program_options.so.1.65.1: 无法添加符号: DSO missing from command line

问题描述:
在编译安装openmvs时,遇到如下问题

undefined reference to symbol '_ZN5boost15program_options29options_description_easy_initclEPKcS3_'
/usr/local/lib/libboost_program_options.so.1.65.1: 无法添加符号: DSO missing from command line
collect2: 错误:ld 返回 1
apps/InterfaceCOLMAP/CMakeFiles/InterfaceCOLMAP.dir/build.make:95: recipe for target 'bin/InterfaceCOLMAP' failed
make[2]: *** [bin/InterfaceCOLMAP] Error 1
CMakeFiles/Makefile2:604: recipe for target 'apps/InterfaceCOLMAP/CMakeFiles/InterfaceCOLMAP.dir/all' failed
make[1]: *** [apps/InterfaceCOLMAP/CMakeFiles/InterfaceCOLMAP.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

问题原因:未找到相关的库,在从cmakelist中添加库的位置即可,如:我出问题的库为libboost_program_options.so.1.65.1,在终端中使用命令locate即可获得该库所在位置

$ locate libboost_program_options.so.1.65.1
/usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.65.1

打开cmakelist,在cmakelist中添加如下

link_libraries("/usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.65.1")

删除cmakecache文件,重新cmake编译即可

你可能感兴趣的:(安装软件)