admin管理员组

文章数量:1635684

今天跑深蓝学院多传感融合第四章作业时,发现没有安装g2o库,按照深蓝学院给的说明,安装此版本的g2o,发现报了以下错误。

CMake Error at core/CMakeLists.txt:49 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "core".
CMake Error at types/data/CMakeLists.txt:24 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "types_data".
CMake Error at types/slam2d/CMakeLists.txt:29 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "types_slam2d".
CMake Error at types/slam3d/CMakeLists.txt:52 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "types_slam3d".
CMake Error at types/sba/CMakeLists.txt:13 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "types_sba".
CMake Error at types/sim3/CMakeLists.txt:12 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "types_sim3".
CMake Error at types/icp/CMakeLists.txt:12 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "types_icp".
CMake Error at types/sclam2d/CMakeLists.txt:19 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "types_sclam2d".
CMake Error at types/slam2d_addons/CMakeLists.txt:24 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "types_slam2d_addons".
CMake Error at types/slam3d_addons/CMakeLists.txt:29 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "types_slam3d_addons".
CMake Error at solvers/pcg/CMakeLists.txt:14 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "solver_pcg".
CMake Error at solvers/dense/CMakeLists.txt:12 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "solver_dense".
CMake Error at solvers/structure_only/CMakeLists.txt:13 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "solver_structure_only".
-- Configuring incomplete, errors occurred!
See also "/home/ysd/Downloads/g2o-20200410_git/g2o/build/CMakeFiles/CMakeOutput.log".

在网上找了很久,找到有人和我类似的问题:
g2o学习记录(3)源码下的example例子运行
然后根据错误提示,找到每个CMakelists.txt文件,将其中的:

  RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}
  LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}
  ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}

修改为:

  RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
  LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
  ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/static

其实这就是一个安装路径设置问题,原来的文件没有设置路径,所以需要自行设置。如果觉得修改麻烦,可以下载安装高博slam14讲的2017g2o 库

本文标签: g2oTARGETSarchiveLibraryTarget