SLAM十四讲 ch12

编译出错:

/home/xxx/slambook/ch12/feature_training.cpp:1:25: fatal error: DBoW3/DBoW3.h: 没有那个文件或目录

解决:

在/home/xxx/slambook/ch12

在/home/xxx/slambook/ch12/CMakeLists.txt中添加:#include "DBoW3/DBoW3.h"

完整CMakeLists.txt为:

cmake_minimum_required( VERSION 2.8 )
project( loop_closure )

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

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

#include "DBoW3/DBoW3.h"
# 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} )

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

add_executable( gen_vocab gen_vocab_large.cpp )
target_link_libraries( gen_vocab ${OpenCV_LIBS} ${DBoW3_LIBS} )

 

你可能感兴趣的:(SLAM十四讲 ch12)