opencv1.0(支持vc6.0)与vc6.0配置
假设安装到E盘下
1、添加环境变量 path下 E:\opencv1.0\bin
2、打开vc6.0进行配置,选择tools->options->Directories,选择include files在下方填入路径
E:\opencv1.0\cxcore\include
E:\
opencv1.0\cv\include
E:\
opencv1.0\cvaux\include
E:\
opencv1.0\ml\include
E:\
opencv1.0\otherlibs\highgui
E:\
opencv1.0\otherlibs\cvcam\include
选择library files 在下方填入路径
E:\opencv1.0\lib
选择source files 在下方填入路径
E:\
opencv1.0\cxcore\src
E:\
opencv1.0\cv\src
E:\
opencv1.0\cvaux\src
E:\
opencv1.0\otherlibs\highgui
E:\
opencv1.0\otherlibs\cvcam\src\windows
3、建立一个工程,手动添加lib 选择 project->settings->link
在object/library modules:
cxcore.lib cv.lib ml.lib cvaux.lib highgui.lib cvcam.lib
完成配置
opencv2.4.9(支持vc10 vc11 vc12)与vs2012配置
假设安装到E盘下
1、添加环境变量 path下 E:\opencv\build\x64\vc11\bin (64位系统选择x64位,32位系统选择x86,vc11为vs2012,vc10为vs2010,vc12为vc2013)
2、项目上右键->属性->vc++目录
可执行文件目录(path目录)添加:
E:\opencv\build\x64\vc11\bin;
包含目录添加:
E:\opencv\build\include\opencv2;
E:\opencv\build\include\opencv;
E:\opencv\build\include;
库目录添加:
E:\opencv\build\x64\vc11\lib;
3、项目上右键->属性->链接器->输入 附加依赖项添加:
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_ml249d.lib
opencv_nonfree249d.lib
opencv_objdetect249d.lib
opencv_ocl249d.lib
opencv_photo249d.lib
opencv_stitching249d.lib
opencv_superres249d.lib
opencv_ts249d.lib
opencv_video249d.lib
opencv_videostab249d.lib
后面带d的为Debug 没有d的为release
4、64位配置
项目上右键->属性->链接器->高级 目标计算机选择
MachineX64
项目上右键->属性->配置管理器->平台 选择
x64