win10+vs2013+OpenCV2.4.13配置

============================
Step1:首先,配置系统环境变量:
(1)右键点击此电脑->属性,点击高级系统环境变量,点击环境变量,首先在用户变量中,编辑Path,添加OpenCV bin路径…\opencv\build\x64\vc12\bin(注:如果为x86,则将x64改为x86)。然后在系统变量中,同样编辑Path,添加OpenCV bin路径…\opencv\build\x64\vc12\bin(注:如果为x86,则将x64改为x86)。

Step2:在vs中一次性配置OpenCV(注:该配置只对该工程有效,当新建另一个工程时,需重新配置,若要永久配置,参见Step3):
(1)打开工程;
(2)点击菜单栏中的视图,选中属性页;
(3)点击VC++目录,编辑包含目录和库目录。在OpenCV2.4.13中包含目录路径为:…\opencv\build\include、…\opencv\build\include\opencv、…\opencv\build\include\opencv2。
库目录路径为:…\opencv\build\x64\vc12\lib(注:如果活动解决方案平台为x86,则将x64改为x86);
(4)点击链接器->输入->附加依赖项,输入:
opencv_ml2413d.lib
opencv_calib3d2413d.lib
opencv_contrib2413d.lib
opencv_core2413d.lib
opencv_features2d2413d.lib
opencv_flann2413d.lib
opencv_gpu2413d.lib
opencv_highgui2413d.lib
opencv_imgproc2413d.lib
opencv_legacy2413d.lib
opencv_objdetect2413d.lib
opencv_ts2413d.lib
opencv_video2413d.lib
opencv_nonfree2413d.lib
opencv_ocl2413d.lib
opencv_photo2413d.lib
opencv_stitching2413d.lib
opencv_superres2413d.lib
opencv_videostab2413d.lib
(5)关闭vs2013,然后重新打开。
Step3:在vs中永久配置OpenCV:
(1)打开工程;
(2)点击菜单栏中的视图,选中其他窗口->属性管理器;
(3)如果是DEBUG模式,则左键点击DEBUG|x64,如果是Release模式,则左键点击Release|x64(此处以DEBUG、x64为例,Release是同样的道理),右键点击Microsoft.Cpp.x64.user->属性。
(4)剩下步骤参见Step2中的(3)-(5)

你可能感兴趣的:(c++)