Found Eigen dependency, but the version of Eigen……编译出现问题

在编译cartographer的时候出现了如下问题:

CMake Error at /usr/local/lib/cmake/Ceres/CeresConfig.cmake:93 (message):
  Failed to find Ceres - Found Eigen dependency, but the version of Eigen
  found (3.2.9) does not exactly match the version of Eigen Ceres was
  compiled with happy().  This can cause subtle bugs by triggering violations
  of the One Definition Rule.  See the Wikipedia article
  http://en.wikipedia.org/wiki/One_Definition_Rule for more details
Call Stack (most recent call first):
  /usr/local/lib/cmake/Ceres/CeresConfig.cmake:223 (ceres_report_not_found)
  CMakeLists.txt:43 (find_package)


-- Configuring incomplete, errors occurred!

搜索问题后发现解决办法
解决方法
按照方法在文件头部添加如下代码后无效。

set(CERES_EIGEN_VERSION 3.2.9)
set(EIGEN_INCLUDE_DIRS "/usr/local/include/eigen3") 

分析代码发现,在提到的编译错误中 (3.2.9)和()空括号里应该分别是编译文件搜索到的Eigen版本号和CERES_EIGEN_VERSION 设置的版本号,但在编译中发现CERES_EIGEN_VERSION 并没有打印出来设置的内容,因此推断set没有产生效果,反复测试后发现,上述set语句应放在参数使用区域附近,至于具体原因,在下没咋看过cmake原理…不太知道,希望了解的大哥可以告知!!!

set(CERES_EIGEN_VERSION 3.2.9)
set(EIGEN_INCLUDE_DIRS "/usr/local/include/eigen3")  

if (EIGEN_FOUND)
  if (NOT EIGEN_VERSION VERSION_EQUAL CERES_EIGEN_VERSION)
    # CMake's VERSION check in FIND_PACKAGE() will accept any version >= the
    # specified version. However, only version = is supported. Improve
    # usability by explaining why we don't accept non-exact version matching.
    ceres_report_not_found("Found Eigen dependency, but the version of Eigen "
      "found (${EIGEN_VERSION}) does not exactly match the version of Eigen "
      "Ceres was compiled with (${CERES_EIGEN_VERSION}). This can cause subtle "
      "bugs by triggering violations of the One Definition Rule. See the "
      "Wikipedia article http://en.wikipedia.org/wiki/One_Definition_Rule "
      "for more details"
	)
  endif ()

错误记录

  • 2
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
要进行Eigen交叉编译,您可以按照以下步骤进行操作: 1. 首先,确保您的环境中已经安装了Ubuntu 18.04和CMake 3.10.2。同时,您还需要安装Eigen 3.3.9库。 2. 打开终端,并执行命令`cmake-gui`来启动CMake图形界面。 3. 在CMake图形界面中,设置源代码路径和构建二进制路径。点击【Browse Source...】按钮选择您的源代码目录,点击【Browse Build...】按钮选择您的构建目录。 4. 点击【Configure】按钮,选择您想要的交叉编译选项。这些选项可能包括目标平台的架构、编译器路径等。 5. 完成配置后,点击【Generate】按钮生成相应的构建文件。 6. 在终端中执行以下命令进行编译:`your_path/bin/arm-linux-gnueabihf-g++ test_eigen.cpp -I./include/eigen3 -o test_eigen`。其中,`your_path`是您的交叉编译工具链的路径,`test_eigen.cpp`是您的源代码文件,`-I./include/eigen3`用于指定Eigen库的头文件路径,`-o test_eigen`用于指定输出的可执行文件名。 通过以上步骤,您就可以完成Eigen的交叉编译并生成可执行文件。请确保您已正确设置交叉编译选项,并且您的编译环境中已经包含了所需的依赖库。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [eigen交叉编译](https://blog.csdn.net/flyfish1986/article/details/123919929)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值