Install opencv for Visual Studio 2015Opencv tutorial how to build opencv from source in Visual Studio 2015. This is usefull when the new version just release and there is no prebuild library awailable.. If you download prebuild libs for windows Visual studio some times agou there is problem the newest VS just mussing. Lets checkt the version of libraries and VS.
Prebuild libs are only for version VC11 and VC12. This mean Visual Studio 2012 and 2013.
This step helps you compile your own opencv libs for VC14 - Visual Studio 2015 Community edition.
Now a days just use NUGET packages in Visual studio and you can code under 1 minutes. here.
Prepare third party libs for opencv
This step depends on your requirements. If you want python lets install python. But i can reccomend to install following parts.
Build opencv 3.0.0Download Opencv 3.0.0 gold
- Extract files folder into C:/opencv-3.0.0
- Prepare Empty folder C:/opencv-build
Build your own OPENCV by CMAKE and VISUAL STUDIO.
- install CMAKE
By this program you generate visual studio Opencv.sln solution file.
Choose windows installer
Windows (Win32 Installer)
- Where is the source code. C:/opencv-3.0.0 (downloaded from git)
- Where to build the binaries C:/opencv-build (empty folder you create)
Select configure button
- Choose Visual Studio 14 2015 Win64 bits of 32 as you like.
- I am using default native compilers options.
- Hit a Finish button
In table name- Choose components you want to install. Just try default first,
Now press Generate button an waith,
This process take some time and copy files and generate Visual Studio OpenCV.sln file in C:/opencv-build folder.
Build and release Opencv 3.0.0 in Visual Studio 2015
- Open Visual Studio 2015
- By file-open-project choose OpenCV.sln in C:/opencv-build
- Visual studio open this projects structure.
- Choose Debug and green start.
- After that choose Release and press green start.
This build and release process can generate some errors.
Look at the details. All this errors in my case are in performance test parts.
- Ok Some errors but in test parts. I dont care. Let install opencv.
Visual Studio 2015 64 bit version
In case you open your build folder before this step and you cant find Opencv Libs and Headers.
You need to do following.
- Choose INSTALL project in visual studio like on picture.
- Build Release only this install project
|Install your project|
The result is 1 succesfully build solution and 0 failded as on picture.
Your installation of opencv is c:/opencv-build/install
There is your header and libs for Visual studio 2015.
i have got only x64 version.
Test Opencv Visual Studio 2015
Include Project in Visul Studio.
Choose Property pages of the project.
Additional Include Directory as C:\opencv-build\install\include
Additional #using Directory as C:\opencv-build\install\include
Additional Library Directories as C:\opencv-build\install\x64\vc14\lib
Additional Dependencies add some libs like
And you can build your Opencv program. You can copy mine from the image but choose your picture.