即将如下三个目录都添加到包含目录中
D:\File Program\opencv\build\include
D:\File Program\opencv\build\include\opencv
D:\File Program\opencv\build\include\opencv2
②添加库目录
仍旧在刚刚的VC++目录右侧,在库目录中添加opencv->build->x86->vc11->lib路径
即:D:\File Program\opencv\build\x86\vc11\lib
注意:这里都是用x64还是x86取决与编译器(而不是操作系统!)
如下图所示,编译器为Win32,那么,就应该选择x86目录下的库
另外:
vc10 = Visual Studio 2010
vc11 = Visual Studio 2012
vc12 = Visual Studio 2013
③添加链接库(即dll)
在“Microsoft.Cpp.Win32.user属性页”的链接器->输入的右侧找到附加依赖项
添加如下dll名称(2.4.9版本-Debug对应的opencv中的动态链接库)
opencv_ml249d.lib
opencv_calib3d249d.lib
opencv_contrib249d.lib
opencv_core249d.lib
opencv_features2d249d.lib
opencv_flann249d.lib
opencv_gpu249d.lib
opencv_highgui249d.lib
opencv_imgproc249d.lib
opencv_legacy249d.lib
opencv_objdetect249d.lib
opencv_ts249d.lib
opencv_video249d.lib
opencv_nonfree249d.lib
opencv_ocl249d.lib
opencv_photo249d.lib
opencv_stitching249d.lib
opencv_superres249d.lib
opencv_videostab249d.lib
注:如果配置的是Release | Win32,那么,需要添加的是如下19个不带d的release版
opencv_objdetect249.lib
opencv_ts249.lib
opencv_video249.lib
opencv_nonfree249.lib
opencv_ocl249.lib
opencv_photo249.lib
opencv_stitching249.lib
opencv_superres249.lib
opencv_videostab249.lib
opencv_calib3d249.lib
opencv_contrib249.lib
opencv_core249.lib
opencv_features2d249.lib
opencv_flann249.lib
opencv_gpu249.lib
opencv_highgui249.lib
opencv_imgproc249.lib
opencv_legacy249.lib
opencv_ml249.lib
另外,对于opencv2.4.8
Debug版
opencv_ml248d.lib
opencv_calib3d248d.lib
opencv_contrib248d.lib
opencv_core248d.lib
opencv_features2d248d.lib
opencv_flann248d.lib
opencv_gpu248d.lib
opencv_highgui248d.lib
opencv_imgproc248d.lib
opencv_legacy248d.lib
opencv_objdetect248d.lib
opencv_ts248d.lib
opencv_video248d.lib
opencv_nonfree248d.lib
opencv_ocl248d.lib
opencv_photo248d.lib
opencv_stitching248d.lib
opencv_superres248d.lib
opencv_videostab248d.lib
Release版