VS2010+OpenCV2.4.3配置(一次设置,永久生效)

一、配置环境变量

 
环境变量path:
D:\openCV2.4.3\opencv\build\x86\vc10\bin

 其中D:\openCV2.4.3\opencv\是我OpenCV安装的home目录,也可以先设置OPENCV_HOME的环境变量名,其值为D:\openCV2.4.3\opencv\,然后在path中添加%OPENCV_HOME%build\x86\vc10\bin


二、VS属性设置

VS2010-【视图】-【其他窗口】-【属性管理器】



Debug | Win32右键属性,在其中设置

VS2010+OpenCV2.4.3配置(一次设置,永久生效)_第1张图片

1、VC++目录:

(若在vs2008中,对应设置为:工具-选项-项目和解决方案-VC++目录,选包含文件和库文件)

 

I、包含目录:

(若在vs2008中,对应设置为:C/C++ -附加包含文件(目录))


D:\openCV2.4.3-extract\opencv\build\include
D:\openCV2.4.3-extract\opencv\build\include\opencv
D:\openCV2.4.3-extract\opencv\build\include\opencv2
 

II、库目录:

若在vs2008,对应设置为:链接器-常规-附加库目录)


D:\openCV2.4.3-extract\opencv\build\x86\vc10\lib
D:\openCV2.4.3-extract\opencv\build\x86\vc10\staticlib 
 (关于形如--error LNK2005:xxx 已经在 msvcrtd.lib ( MSVCR90D.dll ) 中定义出现这个问题,把静态库不包含就行了。)
 (有时候会出现“无法解析的外部符号…… 该符号在函数……被引用”的错误,不确定是不是静态库导致的,最好不要添加静态库staticlib)

2、链接器-输入-附加依赖项:

opencv_contrib243d.lib
opencv_core243d.lib
opencv_features2d243d.lib
opencv_flann243d.lib
opencv_gpu243d.lib
opencv_highgui243d.lib
opencv_imgproc243d.lib
opencv_legacy243d.lib
opencv_ml243d.lib
opencv_objdetect243d.lib
opencv_ts243d.lib
opencv_video243d.lib
 
 
opencv_contrib243.lib
opencv_core243.lib
opencv_features2d243.lib
opencv_flann243.lib
opencv_gpu243.lib
opencv_highgui243.lib
opencv_imgproc243.lib
opencv_legacy243d.lib
opencv_ml243.lib
opencv_objdetect243.lib
opencv_ts243.lib
opencv_video243.lib
 
 
 
opencv_calib3d243.lib
opencv_haartraining_engine.lib
opencv_nonfree243.lib
opencv_photo243.lib
opencv_stitching243.lib
opencv_videostab243.lib
 
opencv_calib3d243d.lib
opencv_haartraining_engined.lib
opencv_nonfree243d.lib
opencv_photo243d.lib
opencv_stitching243d.lib
opencv_videostab243d.lib


NOTE THAT:上面的依赖项名字后面都带着243,因为我安装的OpenCV版本号是2.4.3,如果是别的版本,则依赖项后面的数字就对应其相应版本,比如若是OpenCV2.4.6,则对应的数字是246,其中带d的表示debug的依赖项,不带d的表示release的依赖项。


你可能感兴趣的:(配置,VS2010,永久生效,OpenCV2.4.3,一次设置)