1 | initial version |
You can't use the the Pre-built OpenCV 3.1.0 with Visual Studio 2010. The Windows installation contains binary for VS2013 and VS2015 only.
You have to build OpenCV from source following Installation by Making Your Own Libraries from the Source Files from 1st tutorial.
Suppose you have built a Release version of the library in C:\OpenCV\Build. Using VisualStudio, select the project "Install" and build it... all needed the files will be packaged in C:\OpenCV\Build\install
Define an env var that points to install setx -m OPENCV_ROOT C:\OpenCV\Build\install
OR, if you want, move this folder where you like
mv C:\OpenCV\Build\install C:\yourfolder
setx -m OPENCV_ROOT C:\yourfolder
Configure new projects for OpenCV
$(OPENCV_ROOT)\include
$(OPENCV_ROOT)\$(PLATFORM)\vc10\lib
(v12 for VS2013, v14 for VS2105)opencv_*310.lib
files available in the Lib dirFinally you have to make available the OpenCV's DLL to your executables. You have 3 options
$(OPENCV_ROOT)\$(PLATFORM)\vc10\bin
into your executable folder2 | No.2 Revision |
You can't use the the Pre-built OpenCV 3.1.0 with Visual Studio 2010. The Windows installation contains binary for VS2013 and VS2015 only.
EDIT : added some general infos
You have to build OpenCV from source source following Installation by Making Your Own Libraries from the Source Files from 1st tutorial.
Suppose I strongly suggest to build also the OpenCV Install project.
If you have built a Release version of the library in C:\OpenCV\Build. Using VisualStudio, select the project "Install" and build it... C:\OpenCV\Build\ than the Install project collects all needed the files will be packaged in C:\OpenCV\Build\install this is your OCV_ROOT path.
Define an env var that points to the install folder setx -m
OPENCV_ROOT OCV_ROOT C:\OpenCV\Build\install
OR, if you want, , OR move this the folder where you likewant:
mv C:\OpenCV\Build\install C:\yourfolder
setx -m OPENCV_ROOT OCV_ROOT C:\yourfolder
Configure a new projects project for OpenCV
This is for Visual Studio but the concept is still valid for each IDE. Try to understand 3 basic and general rules:
$(OPENCV_ROOT)\include
$(OPENCV_ROOT)\$(PLATFORM)\vc10\lib
(v12 $(OCV_ROOT)\$(PLATFORM)\vc10\lib (vc12 for VS2013, opencv_*310.libopencv_*(opencv_version).lib
files available in the Lib Finally dir. If you have to make available the OpenCV's DLL to your executables. You have 3 options
d.lib
$(OPENCV_ROOT)\$(PLATFORM)\vc10\bin$(OCV_ROOT)\$(PLATFORM)\vc10\bin
into your executable folderAdditional tips for your Visual Studio+OpenCV projects
Multi-threaded DLL (/MD)
for your Release project and Multi-threaded Debug DLL (/MDd)
for your Debug project