Open Kay1794 opened 6 years ago
One idea is that you seem to be linking with a static library (liblsd_slam.a). This won't, automatically, pull in all the dependent libraries. Can you run:
make VERBOSE=1
and see if it's trying to link in the csparse libraries at all? If not, you'll have to manually include csparse in the target_link_libraries.
(There is a branch on github which uses new-style cmake options which should hopefully address this problem.)
- pull the latest repo of g2o from Github.
- compile it.
- find_package()
- include_directories()
- target_link_libraries() --- NOTICE: G2O has two libraries ${G2O_CORE_LIBRARY} and ${G2O_STUFF_LIBRARY}, instead of the ordinary one ${G2O_LIBRARIES}. You need to specify both of them in this command.
@niebayes Could you please provide a little more detail on how to implement this? Do you think it will solve the issue I just posted? https://github.com/RainerKuemmerle/g2o/issues/423
Hi,
I met this problem when I built a project using g2o.
[100%] Linking CXX executable ../../../bin/sample_app Undefined symbols for architecture x86_64: "g2o::csparse_extension::cs_cholsolsymb(cs_di_sparse const*, double*, cs_di_symbolic const*, double*, int*)", referenced from: g2o::LinearSolverCSparse<Eigen::Matrix<double, 7, 7, 0, 7, 7> >::solve(g2o::SparseBlockMatrix<Eigen::Matrix<double, 7, 7, 0, 7, 7> > const&, double*, double*) in liblsd_slam.a(key_frame_graph.cc.o) "g2o::csparse_extension::writeCs2Octave(char const*, cs_di_sparse const*, bool)", referenced from: g2o::LinearSolverCSparse<Eigen::Matrix<double, 7, 7, 0, 7, 7> >::solve(g2o::SparseBlockMatrix<Eigen::Matrix<double, 7, 7, 0, 7, 7> > const&, double*, double*) in liblsd_slam.a(key_frame_graph.cc.o) "g2o::csparse_extension::cs_chol_workspace(cs_di_sparse const*, cs_di_symbolic const*, int*, double*)", referenced from: g2o::LinearSolverCSparse<Eigen::Matrix<double, 7, 7, 0, 7, 7> >::solveBlocks(double**&, g2o::SparseBlockMatrix<Eigen::Matrix<double, 7, 7, 0, 7, 7> > const&) in liblsd_slam.a(key_frame_graph.cc.o) g2o::LinearSolverCSparse<Eigen::Matrix<double, 7, 7, 0, 7, 7> >::solvePattern(g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, std::__1::vector<std::__1::pair<int, int>, std::__1::allocator<std::__1::pair<int, int> > > const&, g2o::SparseBlockMatrix<Eigen::Matrix<double, 7, 7, 0, 7, 7> > const&) in liblsd_slam.a(key_frame_graph.cc.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [../bin/sample_app] Error 1 make[1]: *** [apps/slam/CMakeFiles/sample_app.dir/all] Error 2 make: *** [all] Error 2
My cmake flags are -DCMAKE_BUILD_TYPE=Release -DBUILD_CSPARSE=ON Not sure if it is a link problem using g2o on macDoes anyone have the same problem?