当我构建项目时,出现以下错误,
Fatal error C1083: Cannot open include file: 'opencv2/core/core_c.h: No such file or directory Similarly for highgui.
因为我已经安装了OpenCV2.4.3,它的路径是C:\opencv。我还在包含目录中添加了这些行
C:opencv\include\opencv
C:opencv\include\opencv2
C:\opencv\include
源代码是:
// #include "stdafx.h"
#include "cv.h"
#include "highgui.h"
int main()
{
IplImage* img = cvLoadImage("C:\\prado.jpg",1);
cvNamedWindow( "test", CV_WINDOW_AUTOSIZE );
cvShowImage( "test", img );
cvWaitKey(0);
cvReleaseImage( &img );
return 0;
} 我觉得一切都很好。我已经在 Release模式下删除了所有内容。我仅尝试 Debug模式。
我所做的 Open CV 配置是:
库文件
最佳答案
这就是我所做的,效果很好:
在包含文件中包含以下路径:
opencv\modules\core\include\opencv2\core
opencv\include\opencv2
opencv\include\opencv
opencv\build\include
在库文件中包含以下路径;
opencv\build\x86\vc9\lib
关于visual-studio-2008 - Visual Studio 2008 中包含文件 core 和 highgui 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14356356/