对Sophus::SO3::vee未定义的引用

对Sophus::SO3::vee(Eigen::Matrix const&)未定义的引用

ubuntu16.04+clion中遇到这种错误:

解决办法:

cmake_minimum_required( VERSION 3.5 )
project( ORBEXERCISE)

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

find_package( OpenCV 3.1 REQUIRED )
find_package( Sophus REQUIRED )
include_directories( 
    ${OpenCV_INCLUDE_DIRS}
    ${Sophus_INCLUDE_DIRS}
    "/usr/include/eigen3/"
)
add_executable( computeORB computeORB.cpp  )
target_link_libraries( computeORB ${OpenCV_LIBS}  ${Sophus_INCLUDE_DIRS} )

add_executable( E2Rt E2Rt.cpp )
target_link_libraries( E2Rt ${OpenCV_LIBS} )

add_executable( GN-BA GN-BA.cpp )
target_link_libraries( GN-BA ${OpenCV_LIBS} )

在CMakeLists.txt中链接库中加

${Sophus_LIBRARIES}

 

你可能感兴趣的:(编程bug)