vc2010 – 青春部落,流年似水 http://www.youthtribe.com 青春是一场远行,总记不起来时的路。 Wed, 10 Jul 2013 14:25:35 +0000 zh-CN hourly 1 https://wordpress.org/?v=6.1.7 vc2010 – 青春部落,流年似水 http://www.youthtribe.com/archives/916 http://www.youthtribe.com/archives/916#respond Wed, 10 Jul 2013 14:06:51 +0000 http://www.youthtribe.com/?p=916 1.单击 项目 ,-〉你的工程名+属性-〉配置属性-〉VC++目录

在右侧显示的 常规中包含目录中 添加:你的opencv安装目录 \opencv2.4.4\opencv\build\include,你的opencv安装目录 \opencv2.4.4\opencv\build\include\opencv,你的opencv安装目录 \opencv2.4.4\opencv\build\include\opencv2,这三项

在库目录中添加 :

你的opencv安装目录opencv2.4.4\opencv\build\x86\vc10\lib

2在链接器-〉输入,右侧 附加依赖项 添加如下:

opencv_calib3d244d.lib opencv_contrib244d.lib opencv_core244d.lib opencv_features2d244d.lib opencv_flann244d.lib opencv_gpu244d.lib opencv_highgui244d.lib opencv_imgproc244d.lib opencv_legacy244d.lib opencv_ml244d.lib opencv_objdetect244d.lib opencv_ts244d.lib opencv_video244d.lib

(这些lib要成一行一行的加, 不然会有LINK : fatal error LNK1104: 无法打开文件”.obj”这个错误)

(注:最后带d的lib适合debug,244实际上是版本,为了方便调试 和发布,所以最好都添加吧)

3.在需要用到opencv的cpp文件中加入:

#include <opencv2/opencv.hpp>

#include <opencv/cv.h>

 

ok。这样好像就可以了。只适用于vc2010 之 cv++

]]>
http://www.youthtribe.com/archives/916/feed 0