【发布时间】:2011-10-24 02:02:02
【问题描述】:
我正在尝试将 opencv 2.3 与 Visual Studio 2010 Express 一起使用。我的代码来自示例:
#include "stdafx.h"
#include <highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
int c;
// allocate memory for an image
IplImage *img;
// capture from video device #1
CvCapture* capture = cvCaptureFromCAM(1);
// create a window to display the images
cvNamedWindow("mainWin", CV_WINDOW_AUTOSIZE);
// position the window
cvMoveWindow("mainWin", 5, 5);
while(1)
{
// retrieve the captured frame
img=cvQueryFrame(capture);
// show the image in the window
cvShowImage("mainWin", img );
// wait 10 ms for a key to be pressed
c=cvWaitKey(10);
// escape key terminates program
if(c == 27)
break;
}
return 0;
}
到目前为止我做了什么?
- 在我的系统路径中添加了
build\bin和build\{x86|x64}\{vc9\vc10\mingw}\bin之一(以使用DLL)。 - 将
build\{x86|x64}\{vc9\vc10\mingw}\lib或build\{x86|x64}\{vc9\vc10\mingw}\staticlib作为库目录添加到我的链接器设置中。 - 在我的编译器设置中添加了
build\include和build\include\opencv作为包含目录。
结果是:
1>LINK : 致命错误 LNK1104: 无法打开文件 'c:\OpenCV2.3\build\x86\vc10\lib.obj'
OpenCV 文件夹中没有lib.obj。我只解压了OpenCV-2.3.0-win-superpack.exe,没有使用CMake软件。
我做错了什么?
【问题讨论】:
标签: c++ c visual-studio-2010 visual-studio opencv