Could not find a configuration file for package opencv2解决 方法

来源:互联网 发布:什么叫软件开发 编辑:程序博客网 时间:2024/06/06 14:03

Remove OpenCv Opencv2 etc. from your run and build depends (in package.xml) as well as from the line find_package( catkin REQUIRED COMPONENTS .... (in CMakeLists.txt)

With catkin in groovy/hydro OpenCV is always embedded as stand-alone package using:

find_package( OpenCV REQUIRED )


(Note than I've added the REQUIRED)

Note that you have also to add OpenCV include directories like

include_directories(  ${catkin_INCLUDE_DIRS}  ${OpenCV_INCLUDE_DIRS} )


and for each of your execs/libs you created as target like

add_executable( my_exec my_cpp_file.cpp )


you need to link against both catkin and OpenCV libs:

target_link_libraries ( my_exec ${OpenCV_LIBRARIES} ${catkin_LIBRARIES} )


0 0