lsd_slam icon indicating copy to clipboard operation
lsd_slam copied to clipboard

Failed to link to g2o on compliation

Open loki1725 opened this issue 9 years ago • 2 comments

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 tog2o::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

loki1725 avatar Aug 24 '15 12:08 loki1725

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.

ghost avatar Oct 08 '15 21:10 ghost

I had the same issue. I did the following steps (don't know which one solved it, but now its compiling fine):

  1. (Re)-Install libsuitparse: sudo apt-get install libsuitesparse-dev
  2. (Re)-Compiling g2o: cd g2o/build/ cmake .. make
  3. And don't forget to install afterwards! sudo make install

c-goettert avatar Jan 22 '17 14:01 c-goettert