1 | initial version |
Hello. As per your question, I guess that you have installed OpenCV but are having problem while compiling and running the code. Here are steps you should follow. 1. Name your .cpp file as main.cpp 2. Create a .txt file and name it as CMakeLists.txt 3. In the CmakeLists.txt file paste the following lines
" cmake_minimum_required(VERSION 2.6) cmake_policy(SET CMP0012 NEW) PROJECT(project)
FIND_PACKAGE(OpenCV 3.0.0 REQUIRED) MESSAGE("OpenCV version : ${OpenCV_VERSION}")
include_directories(${OpenCV_INCLUDE_DIRS}) link_directories(${OpenCV_LIB_DIR}) ADD_EXECUTABLE(app main.cpp) TARGET_LINK_LIBRARIES(app ${OpenCV_LIBS}) " without the doublequotes at the start and the end. Save the file.
2 | No.2 Revision |
Hello. As per your question, I guess that you have installed OpenCV but are having problem while compiling and running the code.
Here are steps you should follow.
1. Name your .cpp file as main.cpp
2. Create a .txt file and name it as CMakeLists.txt
3. In the CmakeLists.txt file paste the following lineslines
" cmake_minimum_required(VERSION 2.6) cmake_policy(SET CMP0012 NEW) PROJECT(project)
#Requires OpenCV FIND_PACKAGE(OpenCV 3.0.0 REQUIRED) MESSAGE("OpenCV version : ${OpenCV_VERSION}")
include_directories(${OpenCV_INCLUDE_DIRS}) link_directories(${OpenCV_LIB_DIR}) ADD_EXECUTABLE(app main.cpp) TARGET_LINK_LIBRARIES(app ${OpenCV_LIBS}) " without the doublequotes at the start and the end. Save the file.