bamvo视觉里程计编译报错‘cv::imshow(cv::String const&, cv::_InputArray const&)’未定义的引用

缺少库导致报错,在CMakeLists.txt中,加上

find_package( OpenCV 3 REQUIRED ) #缺少库,导致报错

完整的CMakeLists.txt文件如下:

cmake_minimum_required(VERSION 2.8.3)
project(bamvo)

find_package(catkin REQUIRED COMPONENTS
  cmake_modules
  cv_bridge
  eigen_conversions
  geometry_msgs
  image_transport
  roscpp
  std_msgs
  tf
  tf_conversions
)

find_package(Boost COMPONENTS system regex timer thread )
find_package(TBB REQUIRED)
find_package( OpenCV 3 REQUIRED ) #缺少库,导致报错

catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES bamvo
#  CATKIN_DEPENDS cmake_modules cv_bridge eigen_conversions geometry_msgs image_transport roscpp std_msgs tf tf_conversions
#  DEPENDS system_lib
)

include_directories(
  ${catkin_INCLUDE_DIRS}
  ${TBB_INCLUDE_DIRS}
  ${Boost_INCLUDE_DIR}
)


add_executable(bamvo_node src/bamvo_node.cpp)
set_target_properties(bamvo_node PROPERTIES COMPILE_FLAGS "${BUILD_FLAGS} -std=c++11 -Ofast -msse -msse2 -msse3 -mavx -march=native -ffast-math -m128bit-long-double")
add_dependencies(bamvo_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ${OpenCV_LIBRARIES})

target_link_libraries(bamvo_node ${catkin_LIBRARIES} ${TBB_LIBRARIES} ${Boost_LIBRARIES} ${OpenCV_LIBRARIES})

上一篇:rust:错误处理 Blocking waiting for file lock on package cache


下一篇:SSIS变量和配置