【问题标题】:cannot use ceres solver,glog无法使用 ceres 求解器,glog
【发布时间】:2017-08-28 15:12:10
【问题描述】:

我在 ubuntu 中安装 ceres 并使用http://ceres-solver.org/installation.html Linux 部分中的所有命令行 sudo apt-get install libgoogle-glog-dev 一直到 进行安装 似乎我已经安​​装了 ceres 求解器,它的依赖没有问题。 但是当我尝试运行测试文件时 bin/simple_bundle_adjuster ../ceres-solver-1.12.0/data/problem-16-22106-pre.txt 表明 无法打开文件 ../ceres-solver-1.9.0/data/problem-16-22106-pre.tx 然后我尝试在教程使用命令中编译 helloworld g++ -I/usr/include/eigen3 helloworld.cpp -o helloworld 它给我带来了很多问题。
未定义对google::InitGoogleLogging(char const*)' helloworld.cpp:(.text+0x104): undefined reference toceres::Problem::Problem()' 的引用 helloworld.cpp:(.text+0x155): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*)' 我没有一一列举。但似乎它根本找不到关于谷歌的东西。 希望你能帮我!! 它给我带来了一大堆问题。

【问题讨论】:

    标签: installation glog ceres-solver


    【解决方案1】:

    听起来你没有链接到图书馆;这将导致引用未定义。如果你正在调用链接器(G++可以是链接器),然后添加-lglog添加结束,它应该然后将它链接到glog。

    同样,您也应该链接到 ceres。

    这是我需要链接以使用使用 Ceres 的库的东西的 sn-p。在 CMake 中。我建议您从底部/末尾开始并在顶部添加内容进行修复,您可能需要在前面加上 -l 表示您需要链接它们。 我建议使用 cmake,这样您就可以简单地将这个列表粘贴到 target_link_libraries(myexecutable listhere) 并删除不必要/未使用的库;

        umfpack
        cxsparse
        stlplus
        glog
        gomp
        ccolamd
        btf
        klu
        cholmod
        lapack
        blas
        camd
        amd
        pthread
        ceres
    

    【讨论】:

    • 谢谢!我已链接到谷神星!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-15
    • 2021-01-13
    • 1970-01-01
    • 2019-06-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多