I've downloaded opencv 3.1 and I want to start a project in Visual Studio 2015. I don't know how to link this library to my project. Also I want to know if I can continue with this opencv cause it just have a x64 and my project doesn't target on 64bits systems.
Download opencv 3.1 for windows
Extract to folder like
c:/opencv
Set environment variables by
setx -m
. This depends on your path.
Type this into command line started by cmd.
setx -m OPENCV_DIR C:\opencv\build\x64\vc14
In the path editor, under control_panels/system/advanced/environmental_variables just set
%OPENCV_DIR%\bin
These are important steps. If you include Opencv project without this Project in visual studio failes because the project can not find DLL library.
Under Project settings in Visual Studio
C/C++/General set Additional Include Directories and Additional #using Directories. For example
C:\opencv\build\include
Under Linker/general set Additional library directories you can use your system path set in installation process or simply include this path for 64 bit version. For example
C:\opencv\build\x64\vc14\lib
orC:\opencv\build\yourTarget\vc14\lib
Under Linker/Input set Additional Dependencies as
opencv_world310.lib
,opencv_world310d.lib
来源:https://stackoverflow.com/questions/35537226/setting-up-opencv-3-1-in-visual-studio-2015