1
votes

This is the first time I am working with opencv in Visual Studio. I have worked in ubuntu though. I was trying to install opencv.
1.I extracted it. Edited the path variable in system properties as D:\opencv\build\x64\vc10\bin

2. I set VCC++ directories as $(OPENCV_BUILD)\x64\vc10\lib;$(LibraryPath).

3.C/C++ additional include directories as $(OPENCV_BUILD)\include\opencv;$(OPENCV_BUILD)\include\opencv2

4. Linker-> input additional dependencies as 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

I am using the following sample code: // OpenCVTest.cpp : Defines the entry point for the console application.

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;
} 

I am getting the following error :: fatal error C1083: Cannot open include file: 'opencv\highgui.h': No such file or directory

1
specify only $(OPENCV_BUILD)\include in the additional include directories.sgarizvi
I am still getting the same error.Mojo Jojo

1 Answers

0
votes

As you are including "$(OPENCV_BUILD)\include\opencv;$(OPENCV_BUILD)\include\opencv2" as library path use

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

as header files in your code.

OR

you can include "$(OPENCV_BUILD)\include" as library path for running the existing code.