1

这是我第一次在 Visual Studio 中使用 opencv。虽然我在 ubuntu 工作过。我试图安装opencv。
1.我提取了。将系统属性中的路径变量编辑为 D:\opencv\build\x64\vc10\bin

2. 我将 VCC++ 目录设置为 $(OPENCV_BUILD)\x64\vc10\lib;$(LibraryPath)。

3.C/C++ 附加包含目录为 $(OPENCV_BUILD)\include\opencv;$(OPENCV_BUILD)\include\opencv2

4. Linker-> 输入附加依赖项为 opencv_core243.lib opencv_imgproc243.lib opencv_highgui243.lib opencv_ml243.lib opencv_video243.lib opencv_features2d243.lib opencv_calib3d243.lib opencv_objdetect243.lib opencv_contrib243.lib opencv_legacy243.lib opencv_flann243.lib

我正在使用以下示例代码: // OpenCVTest.cpp :定义控制台应用程序的入口点。

include "stdafx.h"
include <opencv\highgui.h>
include <opencv\cv.h>
include <opencv\cxcore.h>
int _tmain(int argc, _TCHAR* argv[]) { IplImage *img =         cvLoadImage("C:\Users\firstMap"); cvNamedWindow("OpenCV",1); cvShowImage("OpenCV",img);

cvWaitKey(0);
cvDestroyWindow("OpenCV ");
cvReleaseImage(&img);

return 0;
} 

我收到以下错误 :: 致命错误 C1083:无法打开包含文件:'opencv\highgui.h':没有这样的文件或目录

4

1 回答 1

0

由于您将 "$(OPENCV_BUILD)\include\opencv;$(OPENCV_BUILD)\include\opencv2" 作为库路径使用

include <highgui.h>
include <cv.h>
include <cxcore.h>

作为代码中的头文件。

或者

您可以包含“$(OPENCV_BUILD)\include”作为运行现有代码的库路径。

于 2013-06-06T06:29:50.587 回答