Setting up OpenCV 3.1 in Visual Studio 2015

僤鯓⒐⒋嵵緔 提交于 2020-02-12 16:50:52

问题


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.


回答1:


  1. Download opencv 3.1 for windows

  2. Extract to folder like c:/opencv

  3. 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
  1. 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.

  1. 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 or C:\opencv\build\yourTarget\vc14\lib

    • Under Linker/Input set Additional Dependencies as opencv_world310.lib, opencv_world310d.lib

My tutorial to Visual Sturio 2015 and Opencv 3.1

Use Nuget console to install Opencv in VS



来源:https://stackoverflow.com/questions/35537226/setting-up-opencv-3-1-in-visual-studio-2015

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!