编译中的问题——编译缺少包——但是这个包在电脑上是有的

描述

我想编译ceres-sover的源码,在vins工程中调用,将include和internal连个文件放到vins包下,然后编译

会报错。

1、编译报错信息

CMake Error at multi-vins-fusion/vins_estimator/CMakeLists.txt:39 (find_package):
  By not providing "FindSuiteSparse.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "SuiteSparse", but CMake did not find one.

  Could not find a package configuration file provided by "SuiteSparse" with
  any of the following names:

    SuiteSparseConfig.cmake
    suitesparse-config.cmake

  Add the installation prefix of "SuiteSparse" to CMAKE_PREFIX_PATH or set
  "SuiteSparse_DIR" to a directory containing one of the above files.  If
  "SuiteSparse" provides a separate development package or SDK, be sure it
  has been installed.

或者:

0: fatal error: SuiteSparseQR.hpp: No such file or directory
   44 | #include "SuiteSparseQR.hpp"

CMakeLists.txt:
	find_package(SuiteSparse)

**

2、单独编译ceres-sover包就不会出现这个问题。。。崩溃

**

仔细看了ceres-sover的CMakeLists.txt,发现它里面也有类似命令find_package(SuiteSparse),但是它找不到不会报错能够继续,不过它里面有个cmake文件夹,下面有FindSuiteSparse.cmake文件,推测它是通过cmake去找的这个文件。

解决方法:
既然找到了问题的原因,那就让编译时系统也去调用这个FindSuiteSparse.cmake文件,修改CMakeLists.txt

include(/home/yjh/tem/bak/ceres-solver/cmake/FindSuiteSparse.cmake)
find_package(SuiteSparse)

然后编译
同样会打印
has asked CMake to find a package configuration file provided by
“SuiteSparse”, but CMake did not find one.

Could not find a package configuration file provided by “SuiteSparse” with
any of the following names:

SuiteSparseConfig.cmake
suitesparse-config.cmake

不过系统好像可以正常编译了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值