在Visual Studio下报错fatal error C1083: Cannot open include file: 'cv.h': No such file or directory

在Visual Studio下报错fatal error C1083: Cannot open include file: 'cv.h': No such file or directory

 

不知道你安装OpenCV没有,没有就需要安装,安装后见如下操作:

在VS的项目设置中添加openCV的头文件路径。还有,设置这些引用等。

菜单Tools->Options->Directories:先设置lib路径,选择Library files,在下方填入路径:

C:\Program Files\OpenCV\lib

然后选择include files,在下方填入路径:

C:\Program Files\OpenCV\cxcore\include
C:\Program Files\OpenCV\cv\include
C:\Program Files\OpenCV\cvaux\include
C:\Program Files\OpenCV\ml\include
C:\Program Files\OpenCV\otherlibs\highgui
C:\Program Files\OpenCV\otherlibs\cvcam\include

然后选择source files,在下方填入路径:

C:\Program Files\OpenCV\cv\src
C:\Program Files\OpenCV\cxcore\src
C:\Program Files\OpenCV\cvaux\src
C:\Program Files\OpenCV\otherlibs\highgui
C:\Program Files\OpenCV\otherlibs\cvcam\src\windows

项目设置

每创建一个将要使用OpenCV的VC Project,都需要给它指定需要的lib。菜单:Project->Settings,然后将Setting for选为All Configurations,然后选择右边的link标签,在Object/library modules附加上

cxcore.lib cv.lib ml.lib cvaux.lib highgui.lib cvcam.lib

 

如何在VC6.0下配置OPENCV1.0参考网站:http://www.opencv.org.cn/index.php/VC6%E4%B8%8B%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AEOpenCV1.0

你可能感兴趣的:(在Visual Studio下报错fatal error C1083: Cannot open include file: 'cv.h': No such file or directory)