Ubuntu16.04,ROS kinecticgit
報錯信息爲「github
make[2]: *** No rule to make target '/home/william/slam/g2o/lib/libg2o_csparse_extension.so', needed by '/home/william/catkin_ws/devel/lib/rgbdslam/rgbdslam'. Stop.
CMakeFiles/Makefile2:5881: recipe for target 'rgbdslam_v2/CMakeFiles/rgbdslam.dir/all' failed
make[1]: *** [rgbdslam_v2/CMakeFiles/rgbdslam.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed架構
」ui
報錯緣由以下:spa
1. 先是按照https://github.com/felixendres/rgbdslam_v2上的README.md來安裝.net
2. 出現G2O引發的bug,在編譯安裝g2o時經過,卻在編譯rgbdslam中報錯,依照https://hubpages.com/technology/Instructions-for-compiling-rgbdslam-v2-on-a-fresh-Ubuntu-1604-install-ros-kinetic-in-virtualbox中的6,解決了blog
缺乏依賴,執行sudo apt-get install libsuitesparse-dev(裝依賴後再裝G2O會好一點),在報錯以後安裝依賴,若是不行,就裝完依賴後再安裝g2oip
我以爲本次主要講的大bug就是從這裏引發的ci
3. 遇到https://blog.csdn.net/zhuoyueljl/article/details/78536996?reload中,「required process[rgbdslam-2] has died」......Iinitiating down」問題,解決後,編譯出現needed by錯誤get
解決方法爲:
工做空間(也有多是編譯G2O時纔會出現)的cmake_modules中(位於SRC)有個FindG2O.cmake的文件,將其移除掉就能夠了,由於用3的方法,make install了G2O,所以不須要cmake_modules來找G2O的包
PS:
學到的幾個小技巧
1 使用grep搜索文件中的文本信息,語法是
grep -rw PATTERN [file]
2. 在CMakeLists.txt中,設置找包的路徑:
set(G2O ‘包的絕對路徑’)
反思總結:
1. 一樣是對編譯錯誤進行查找,在報錯信息提示找不到這個 ibg2o_csparse_extension.so 文件時,我傾向於使用grep去搜索,rgbdsla包中哪行代碼對這個文件進行查找,可是結果明顯是找不到的。這是對整個編譯架構的不理解
2. 不過,在沒有其餘經驗的前提下,作點什麼老是比什麼都不作來得好。