Error linking opencv [closed]

asked 2017-06-12 06:53:48 -0600

shashank gravatar image

I have problem linking opencv 3 . If i use #include<opencv2 core="" version.hpp=""> it links to /opt/ros/kinetic/include/opencv-3.2.0 dev/opencv/core/version.hpp. But i have a opencv in /usr/local/include which i want to use .

My cmake file is this

make_minimum_required(VERSION 2.8.3) project(mipi_camera) find_package(catkin REQUIRED COMPONENTS cv_bridge
image_transport roscpp sensor_msgs std_msgs OpenCV REQUIRED ) include_directories(
${OpenCV_INCLUDE_DIRS} # /usr/include/opencv;/usr/include ) target_link_libraries(${PROJECT_NAME}_node ${catkin_LIBRARIES} ${OpenCV_LIBS}

If I use just opencv without ROS . It takes opencv from /usr/local/include/.

cmake_minimum_required(VERSION 2.8) project( DisplayImage ) find_package( OpenCV 3 REQUIRED ) add_executable( DisplayImage DisplayImage.cpp ) target_link_libraries( DisplayImage ${OpenCV_LIBS} )

How to solve this issue ?

edit retag flag offensive reopen merge delete

Closed for the following reason OpenCV Question: THe OpenCV community prefers to answer questions at: by tfoote
close date 2018-08-08 01:28:18.049946