一共需要完成三个配置操作
1、Include Directories
2、Library Directories
3、Additional Dependencies
首先建立一个win32 Console Application 空模板
打开VIEW-> Other Windows-> Property Manager
你会在屏幕左边看到这个
双击 Microsoft.Cpp.Win32.user,出现这个
Common Properties-> VC++ Directories
首先改include Directories:添加3个绝对路径
E:\Downloads\opencv\build\include
E:\Downloads\opencv\build\include\opencv
E:\Downloads\opencv\build\include\opencv2
然后改Library Directories:添加1个绝对路径
E:\Downloads\opencv\build\x86\vc12\lib
如下图:
Linker -> Input
改Additional Dependencies:添加进lib文件夹中所有 .lib文件的文件名
如果你是opencv3的话就添加以下:
opencv_ts300.lib
opencv_ts300d.lib
opencv_world300d.lib
opencv_world300.lib
如下图: