天天看点

错误:/usr/lib/x86_64-linux-gnu/libgomp.so.1: error adding symbols: DSO missing from command line

编译lio-mapping的时候出现如下错误

/usr/bin/ld: /usr/local/lib/libceres.a(schur_eliminator_2_2_2.cc.o): undefined reference to symbol '[email protected]@GOMP_1.0'
//usr/lib/x86_64-linux-gnu/libgomp.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
lio-mapping/CMakeFiles/lio_estimator_node.dir/build.make:814: recipe for target '/home/yang/catkin_ws/devel/lib/lio/lio_estimator_node' failed
make[2]: *** [/home/yang/catkin_ws/devel/lib/lio/lio_estimator_node] Error 1
CMakeFiles/Makefile2:4490: recipe for target 'lio-mapping/CMakeFiles/lio_estimator_node.dir/all' failed
make[1]: *** [lio-mapping/CMakeFiles/lio_estimator_node.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

           

解决办法:

在Cmakelists.txt文件中加-lgomp,加的位置如下

set(lio_EXT_LIBS
  ${PCL_LIBRARIES}
  ${OpenCV_LIBRARIES}
  ${GFLAGS_LIBRARIES}
  ${GLOG_LIBRARIES}
  -lgomp
)
           

继续阅读