lsd_slam
lsd_slam copied to clipboard
Failed to link to g2o on compliation
I'm trying to a fresh install of LSD_SLAM and it's failing during the last stages.
[ 96%] Built target lsdslam
Linking CXX executable LSD
src/lib/liblsdslam.so: undefined reference to g2o::csparse_extension::cs_chol_workspace(cs_di_sparse const*, cs_di_symbolic const*, int*, double*)' src/lib/liblsdslam.so: undefined reference to
g2o::csparse_extension::cs_cholsolsymb(cs_di_sparse const_, double_, cs_di_symbolic const_, double_, int_)'
src/lib/liblsdslam.so: undefined reference to `g2o::csparse_extension::writeCs2Octave(char const_, cs_di_sparse const_, bool)'
collect2: error: ld returned 1 exit status
make[2]: *_* [LSD] Error 1
make[1]: *** [CMakeFiles/LSD.dir/all] Error 2
make: *** [all] Error 2
I have g2o installed, and verified it works. All of the libraries are in /usr/local/lib, and I've verified that lib2go_csparse_extension.so is there. I don't have any issues during cmake with missing dependencies.
I can't tell if this is an issue with lsd_slam or g2o, but since g2o seems to be working elsewhere I thought I would start here.
Thanks for any help
I had to add this to the main CMakeLists.txt file:
# g2o
add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/g2o)
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/g2o)
link_directories(${PROJECT_SOURCE_DIR}/thirdparty/g2o/lib)
in order to solve it.
I had the same issue. I did the following steps (don't know which one solved it, but now its compiling fine):
- (Re)-Install libsuitparse:
sudo apt-get install libsuitesparse-dev
- (Re)-Compiling g2o:
cd g2o/build/
cmake ..
make
- And don't forget to install afterwards!
sudo make install