0
votes

I install ceres in ubuntu and use the all of the command line in http://ceres-solver.org/installation.html Linux part from sudo apt-get install libgoogle-glog-dev all the way to make install Seems I have installed ceres solver and it dependency without problem. But when I try to run the test file bin/simple_bundle_adjuster ../ceres-solver-1.12.0/data/problem-16-22106-pre.txt It shows unable to open file ../ceres-solver-1.9.0/data/problem-16-22106-pre.tx Then I try to compile helloworld in tutorial use command g++ -I/usr/include/eigen3 helloworld.cpp -o helloworld It gives me a bunch of problems.
undefined reference to 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*)' I didn't list them all. But seems it cannot find things about google at all. Hope you can help me!! it gives me a mountain of problems.

1

1 Answers

1
votes

Sounds like you're not linking to the library; this would cause references to be undefined. If you are calling the linker (G++ can be the linker), then add -lglog add the end, it should then link it to glog.

Similarly, you should also link to ceres.

Here's a snippet from the things I need to link to use a library which uses Ceres. In CMake. I suggest you start at the bottom/end and add things to the top to fix, you may need to prefix with -l to indicate that you need to link them. I recommend using cmake, so that you can simply paste this list in a target_link_libraries(myexecutable listhere) and remove unnecessary/unused libraries;

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