Build applications with OpenCV inside the Microsoft Visual Studio 2015 C++

Learning Start from 2017/1/10

Official tutorial from OpenCV windows_visual_studio_Opencv

Main point:

Set path enviroment in Window system, Include library and OpenCV header path  in VS C++. Change depend on Debug/ Release Or X86/64

Create properties file at properties manager tab will help you save time

$(OPENCV_DIR)\x86\vc12\bin;

winpath

Next go to the Linker ‣ General and under the “Additional Library Directories” add the libs directory:

$(OPENCV_DIR)\lib

Use for example the OpenCV_Debug name. Then by selecting the sheet Right Click ‣ Properties. In the following I will show to set the OpenCV rules locally, as I find unnecessary to pollute projects with custom rules that I do not use it. Go the C++ groups General entry and under the “Additional Include Directories” add the path to your OpenCV include. If you don’t have “C/C++” group, you should add any .c/.cpp file to the project.

$(OPENCV_DIR)\..\..\include
Advertisements