我用的是VS2013和OpenCV2.4.9版本
首先配置环境变量:
其中的位置,看你OpenCV具体的安装位置
在系统变量里找到Path变量,在Path中添加值SDK中的bin目录。
D:\opencv\build\x86\vc12\bin。
在用户变量里,新建一个opencv的变量值为
D:\opencv\build(根据解压目录)
PATH里增加(注:中间加;隔开,是英文状态下的)
D:\opencv\build\x86\vc12\bin
VC++工程配置
可执行文件目录
添加D:\opencv\build\x86\vc12\bin
包含目录
D:\opencv\build\include
D:\opencv\build\include\opencv2
D:\opencv\build\include\opencv
库目录
D:\opencv\build\x86\vc12\lib
附加依赖项的配置
opencv_calib3d249d.lib
opencv_contrib249d.lib
opencv_core249d.lib
opencv_features2d249d.lib
opencv_flann249d.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
opencv_nonfree249.lib
opencv_objdetect249.lib
opencv_photo249.lib
opencv_stitching249.lib
opencv_ts249.lib
opencv_video249.lib
opencv_videostab249.lib
opencv_gpu249d.lib
opencv_highgui249d.lib
opencv_imgproc249d.lib
opencv_legacy249d.lib
opencv_ml249d.lib
opencv_nonfree249d.lib
opencv_objdetect249d.lib
opencv_photo249d.lib
opencv_stitching249d.lib
opencv_ts249d.lib
opencv_video249d.lib
opencv_videostab249d.lib