Ask Your Question
0

opencv installed with visual studio 2010, but shows error with header files cv.h , highgui.h

asked 2013-05-30 05:09:22 -0600

newbie111 gravatar image

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 Please help me, I am stuck :-(

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-05-30 08:14:49 -0600

berak gravatar image

try with :

$(OPENCV_BUILD)\include

instead of

$(OPENCV_BUILD)\include\opencv

for your include path, since it is:

#include <opencv\cv.h>  // opencv is already here

also, remember, that you need like: opencv_objdetect243d.lib ( d at the end ) for all opencv libraries in DEBUG configuration

good luck ;)

edit flag offensive delete link more

Comments

Thanks for replying :) I tried that out but I am still getting the same error. Moreover these header files reside in opencv\build\include\opencv2\highgui\highgui.hpp and opencv\include\opencv\cv and opencv\build\include\opencv\cxcore , should I write the complete address with include??? :/

newbie111 gravatar imagenewbie111 ( 2013-05-30 23:59:09 -0600 )edit

Tried that too :( It says " Cannot open include file: 'opencv\build\include\opencv2\highgui.h': No such file or directory BUILD FAILED " Any idea what can be wrong??

newbie111 gravatar imagenewbie111 ( 2013-05-31 00:01:55 -0600 )edit

if you want to use the old 1.0 api:

#include "opencv/highgui.h"

for the 2.x api:

#include "opencv2/highgui/highgui.hpp"

in both cases your "addidtional include dir" should point to :

$(OPENCV_BUILD)\include
berak gravatar imageberak ( 2013-05-31 01:05:49 -0600 )edit

Question Tools

Stats

Asked: 2013-05-30 05:09:22 -0600

Seen: 6,772 times

Last updated: May 30 '13