Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

g2o - csparse linker issue #295

Open
mudit1729 opened this issue Jan 31, 2023 · 3 comments
Open

g2o - csparse linker issue #295

mudit1729 opened this issue Jan 31, 2023 · 3 comments

Comments

@mudit1729
Copy link

CMakeFiles/bundle_adjustment_g2o.dir/bundle_adjustment_g2o.cpp.o: In function g2o::LinearSolverCSparse<Eigen::Matrix<double, 9, 9, 0, 9, 9> >::solve(g2o::SparseBlockMatrix<Eigen::Matrix<double, 9, 9, 0, 9, 9> > const&, double*, double*)': bundle_adjustment_g2o.cpp:(.text._ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9_[_ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9_]+0x51): undefined reference to g2o::csparse::CSparse::hasSymbolic() const'
bundle_adjustment_g2o.cpp:(.text.ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9[ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9]+0xa1): undefined reference to g2o::csparse::CSparse::sparseView()' bundle_adjustment_g2o.cpp:(.text._ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9_[_ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9_]+0x6ea): undefined reference to g2o::csparse::CSparse::analyze()'
bundle_adjustment_g2o.cpp:(.text.ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9[ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9]+0x72d): undefined reference to g2o::csparse::CSparse::solve(double*, double*) const' bundle_adjustment_g2o.cpp:(.text._ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9_[_ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9_]+0x76a): undefined reference to g2o::csparse::CSparse::choleskyNz() const'
bundle_adjustment_g2o.cpp:(.text.ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9[ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9]+0x993): undefined reference to g2o::csparse::CSparse::writeSparse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' bundle_adjustment_g2o.cpp:(.text._ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9_[_ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9_]+0xcce): undefined reference to g2o::csparse::CSparse::amd(g2o::csparse::CSparse::SparseView const&, Eigen::Matrix<int, -1, 1, 0, -1, 1>&)'
bundle_adjustment_g2o.cpp:(.text.ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9[ZN3g2o19LinearSolverCSparseIN5Eigen6MatrixIdLi9ELi9ELi0ELi9ELi9EEEE5solveERKNS_17SparseBlockMatrixIS3_EEPdS9]+0xe91): undefined reference to `g2o::csparse::CSparse::analyze_p(int*)'
collect2: error: ld returned 1 exit status
CMakeFiles/bundle_adjustment_g2o.dir/build.make:97: recipe for target 'bundle_adjustment_g2o' failed
make[2]: *** [bundle_adjustment_g2o] Error 1
CMakeFiles/Makefile2:112: recipe for target 'CMakeFiles/bundle_adjustment_g2o.dir/all' failed
make[1]: *** [CMakeFiles/bundle_adjustment_g2o.dir/all] Error 2

While building ch9

@BTREE-C802
Copy link

BTREE-C802 commented Jan 31, 2023 via email

@MingHongDev
Copy link

I fixed it myself. The problem my cause by the link error between g2o and CSparse.
So, first install libsuitesparse-dev, then compile and make install g2o again.

@BTREE-C802
Copy link

BTREE-C802 commented May 26, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants