jserv / lsd_slam

LSD-SLAM
GNU General Public License v3.0
49 stars 41 forks source link

Failed to link to g2o on compliation #2

Open loki1725 opened 9 years ago

loki1725 commented 9 years ago

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_disparse const, double_, cs_disymbolic const, double, int)' src/lib/liblsdslam.so: undefined reference to `g2o::csparseextension::writeCs2Octave(char const, cs_disparse 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

ghost commented 8 years ago

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.

c-goettert commented 7 years ago

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