vs2013中将OpenCV程序由x64转化为x86

1.修改环境变量 (我的电脑右键属性,然后选择高级系统设置里的环境变量。。记得编辑就好,不要新建)
将path的值由%OPENCV%\x64\vc12\bin改为%OPENCV%\x86\vc12\bin

2.修改解决方案平台(vs2013调试的右边)
将x64切换为win32

3.修改预处理器
在属性管理器-配置属性-C\C++里,找到预处理器项,加入_CRT_SECURE_NO_WARNINGS

4.修改库目录 (右键项目名,选属性,里的VC++目录)
将F:\软件\opencv\opencv\build\x64\vc12\lib
改为
F:\软件\opencv\opencv\build\x86\vc12\lib
(如果出现在继承的值里不能编辑,就取消勾选 从父级或项目默认设置继承,然后点新建,将里面的几个一一复制。。。记得要改的这个写成新的)
若没有修改可能会造成x86和目标计算机x64不符

5.从.dll安装目录&(OpenCV)\build\x86\vc12\bin,将opencv_imgproc2410d.dll opencv_core2410d.dll opencv_highgui2410d.dll分别复制到C:\Windows\SysWOW64\

6.如果出现无法打开文件“opencv_world300d.lib
打开属性管理器-配置属性-链接器-输入,在附加依赖项里取消勾选从父级或项目默认设置继承。
【vs2013中将OpenCV程序由x64转化为x86】如果原来全部为继承项,取消勾选后链接器里便没内容了,这时候将这些添加进去(opencv版本为2.4.10)
opencv_calib3d2410d.lib
opencv_contrib2410d.lib
opencv_core2410d.lib
opencv_features2d2410d.lib
opencv_flann2410d.lib
opencv_highgui2410d.lib
opencv_imgproc2410d.lib
opencv_legacy2410d.lib
opencv_ml2410d.lib
opencv_nonfree2410d.lib
opencv_objdetect2410d.lib
opencv_ocl2410d.lib
opencv_photo2410d.lib
opencv_stitching2410d.lib
opencv_superres2410d.lib
opencv_ts2410d.lib
opencv_video2410d.lib
opencv_videostab2410d.lib
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
odbccp32.lib



    推荐阅读