全局设置:
VC6.0菜单->Tools->Options->Directories:设置lib路径,选择Library files,在下方填入OpenCV的安装路径
接着选择include files在下方填入路径
\OpenCV\cxcore\include
\OpenCV\cv\include
\OpenCV\otherlibs\highgui
\OpenCV\otherlibs\cvcam\include
\OpenCV\cvaux\include
\OpenCV\ml\include
创建新任务->MFC AppWizard[exe]->Single document->Finish
点击运行->单文本简单任务框架\MFC
每创建一个将要使用OpenCV的VC Project:
都需要给它指定需要的lib:菜单:Project->Setings.
然后将Setting for选为All Configurations,然后选择右边的link标签,在
Object/library modules 附加上cxcore.lib cv.lib ml.lib cvaux.lib highgui.lib cvcam.lib
也可以在程序中添加以下代码达到同样的效果:
//#pragma comment(lib.”cv.lib”)
//#pragma comment(lib.”cxcore.lib”)
//#pragma comment(lib.”hiahgui.lib”)
//#pragma comment(lib.”cvaux.lib”)
//#praama comment(lib.”cvcam.lib”)