我正在尝试在Visual Studio 2010 Express中使用OpenCV 2.3。我的代码来自示例:
#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软件。
我做错了什么?