0、配置好opencv的环境变量
1、新建属性页
2、配置属性页,直接拷贝
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<!-- opencv 2.4.10 supported -->
<OpencvPath>D:\wxf\opencv\build</OpencvPath>
</PropertyGroup>
<PropertyGroup>
<LibraryPath>$(OpencvPath)\x64\vc12\lib;$(LibraryPath)</LibraryPath>
<IncludePath>$(OpencvPath)\include;$(OpencvPath)\include\opencv;$(OpencvPath)\include\opencv2;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup>
<Link Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<AdditionalDependencies>
opencv_ml2410d.lib;
opencv_calib3d2410d.lib;
opencv_contrib2410d.lib;
opencv_core2410d.lib;
opencv_features2d2410d.lib;
opencv_flann2410d.lib;
opencv_gpu2410d.lib;
opencv_highgui2410d.lib;
opencv_imgproc2410d.lib;
opencv_legacy2410d.lib;
opencv_objdetect2410d.lib;
opencv_ts2410d.lib;
opencv_video2410d.lib;
opencv_nonfree2410d.lib;
opencv_ocl2410d.lib;
opencv_photo2410d.lib;
opencv_stitching2410d.lib;
opencv_superres2410d.lib;
opencv_videostab2410d.lib;
%(AdditionalDependencies)
</AdditionalDependencies>
</Link>
<Link Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<AdditionalDependencies>
opencv_objdetect2410.lib;
opencv_ts2410.lib;
opencv_video2410.lib;
opencv_nonfree2410.lib;
opencv_ocl2410.lib;
opencv_photo2410.lib;
opencv_stitching2410.lib;
opencv_superres2410.lib;
opencv_videostab2410.lib;
opencv_calib3d2410.lib;
opencv_contrib2410.lib;
opencv_core2410.lib;
opencv_features2d2410.lib;
opencv_flann2410.lib;
opencv_gpu2410.lib;
opencv_highgui2410.lib;
opencv_imgproc2410.lib;
opencv_legacy2410.lib;
opencv_ml2410.lib;
%(AdditionalDependencies)
</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
3、在属性管理器中添加属性页