高翔视觉slam十四讲第二版第十一章DBow3词库安装与出现的问题

1、从Github上现在DBow3词袋模型库

git clone https://github.com/rmsalinas/DBow3.git

把解压缩后的文件放入slambook文件夹中的3drparty中,开始安装

2、开始安装DBow3库,进入DBow3目录

1 mkdir build
2 cd build/
3 cmake ..
4 make
5 sudo make install

安装完成!

3.运行程序出现的问题:

make[3]: *** No rule to make target '/usr/local/lib/libDBoW3.a', needed by 'feature_training'.  Stop.
CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/feature_training.dir/all' failed
make[2]: *** [CMakeFiles/feature_training.dir/all] Error 2
CMakeFiles/Makefile2:121: recipe for target 'CMakeFiles/feature_training.dir/rule' failed
make[1]: *** [CMakeFiles/feature_training.dir/rule] Error 2

第一行:No rule to make target '/usr/local/lib/libDBoW3.a’
或者显示:

no rule to make target '/usr/local/lib/libDBow3.so'

第一种情况只需要将CMakeList.txt中的libDBow3.so改为libDBow3.a即可。

第二种情况把.a改为.so。CMakeList.txt如下:倒数第四行

cmake_minimum_required( VERSION 2.8 )
project( loop_closure )

set( CMAKE_BUILD_TYPE "Release" )
set( CMAKE_CXX_FLAGS "-std=c++11 -O3" )

# opencv libDBow3.so
find_package( OpenCV 3.1 REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )

# dbow3 
# dbow3 is a simple lib so I assume you installed it in default directory 
set( DBoW3_INCLUDE_DIRS "/usr/local/include" )
set( DBoW3_LIBS "/usr/local/lib/libDBoW3.a" )

add_executable( feature_training feature_training.cpp )
target_link_libraries( feature_training ${OpenCV_LIBS} ${DBoW3_LIBS} )

你可能感兴趣的:(高翔视觉slam十四讲第二版第十一章DBow3词库安装与出现的问题)