Hi, I am following your tutorials for setting up OpenCV and building DisplayImage app on Ubuntu 16.04. I successfully downloaded the source code from Sourceforge.net and extracted it to a directory /opt/opencv. In the /opt/opencv/opencv-3.3.0 directory I created a new subdirectory /release and built OpenCV in /release. (reference: https://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html)
I created a separate project directory in ~/Desktop for the DisplayImage tutorial and created the following CMakeLists.txt file:
cmake_minimum_required(VERSION 2.8)
project(DisplayImage)
set(OpenCV_DIR /opt/opencv/opencv-3.3.0/release)
find_package(OpenCV REQUIRED)
add_executable(DisplayImage DisplayImage.cpp)
message("Libs: ${OpenCV_LIBS}")
target_link_libraries(DisplayImage ${OpenCV_LIBS})
When I run the make
command, I get the error below:
make[2]: *** No rule to make target '/opt/opencv/opencv-3.3.0/release/lib/libopencv_dnn.so.3.3.0', needed by 'DisplayImage'. Stop.
CmakeFiles/Makefile2:67: recipe for target 'CMakeFiles/DisplayImage.dir/all' failed
make[1]: *** [CMakeFiles/DisplayImage.dir/all] Error 2
MakeFile:83: recipe for target 'all' failed
make: *** [all] Error 2
The output of message("Libs: ${OpenCV_LIBS}")
is:
Libs: opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;
opencv_highgui;opencv_imgcodecs;opencvimgproc;opencv_ml;opencv_objdetect;
opencv_photo;opencv_shape;opencv_stitching;opencv_superres;opencv_video;
opencv_videoio;opencv_videostab
Please help. I followed the tutorials to the letter. Reference: https://docs.opencv.org/2.4/doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.html