qt is not able to locate header files of opencv
hello people
I m new to qt and opencv. from the last 24 hours i m trying to link qt with opencv. i have read all the related posts on this forum. but nothing worked out. plz someone help me.
plz tell me why qt is not able to locate the header files of opencv.
the procedure i adopted is given as follows:
1. downloaded opencv 2.3.1, qtsdk 4.7.4 and cmake 2.8.
2. generated binary files of opencv by following the tutorial http://knowtheabc.wordpress.com/2011...nd-qt-creator/
3. initially i extracted opencv files in the folder named as "opencv" located at C:\Program Files\opencv. Then i
generated binary files in the folder named as "opencv_binary" located at C:\Program Files\opencv_binary.
4. when the binary files got generated i copied the folder "opencv_binary" in "opencv" itself.
5. now after writing the code i modified .pro file as follows:
i appended the following code to .pro file:
INCLUDEPATH += C:\Program Files\opencv\include\opencv\
LIBS += -LC:\Program Files\opencv\opencv_binary\lib\
-lopencv_core220 \
-lopencv_highgui220 \
-lopencv_imgproc220 \
-lopencv_features2d220 \
-lopencv_calib3d220
6. and the header files i am using are like this:
#include "cv.h"
#include "cvaux.h"
#include "highgui.h"
7. now when i build this project it says "no such file or directory exist".
8. Also i have changed the PATH variable to include C:\QtSDK\mingw\bin;C:\Program Files\opencv\opencv_binary\bin;
I don know whats wrong with these steps. someone please help. I am working on a final year project and have to submit it by the day after tomorrow. Its really urgent. Please HELP!!
Re: qt is not able to locate header files of opencv
Try
Code:
INCLUDEPATH += "C:\Program Files\opencv\include\opencv"
LIBS += -L"C:\Program Files\opencv\opencv_binary\lib" \
-lopencv_core220 \
-lopencv_highgui220 \
-lopencv_imgproc220 \
-lopencv_features2d220 \
-lopencv_calib3d220
Re: qt is not able to locate header files of opencv
I tried it but it din't work.
Plz giv some more suggestions..
Re: qt is not able to locate header files of opencv
Actually it should work, if the paths are correct.
Have you rerun qmake after changing .pro?
Re: qt is not able to locate header files of opencv
umm..i have rebuilt it. But i dint get what do u mean by "re-run qmake"
Re: qt is not able to locate header files of opencv
After changing pro file you should run qmake again to have correct makefiles. Right click on your project and select "Run qmake".
Re: qt is not able to locate header files of opencv
yes i followed it..but still it is not working
Re: qt is not able to locate header files of opencv
OK, I can't say what is wrong, but having spaces in include/lib paths isn't good (although it should work with quotes). Try to move include dir to somewhere like c:\opencv, then change .pro file:
Code:
INCLUDEPATH += c:/opencv/include
and in your sources use:
Code:
#include <opencv/cv.h>
#include <opencv/cvaux.h>
#include <opencv/highgui.h>
It should find headers fine. At least it works for me in such way in my projects.
Re: qt is not able to locate header files of opencv
thanx Oleg Shparber!
My problem is solved.