Hello all of you!
this is my first post so please forgive me for any rule breaking and orient me so i do not make the same mistakes inf future posts!
Well, first things first, i know there are a lot of qt+opencv posts already but after reading all of them (and i really mean ALL in the Newbie), i still can't figure out how to make the most simple piece of software running.
As said in the title, i am running the latest QtSDK (1.1.3 online installer, downloaded here) and the most recent opencv (2.3.1 downloaded here). I'm running win7 pro SP1 32bit.
I think i should also mention i have CMake2.8, microsoft visual c++ express edition (with SP1) and microsoft visual studio 2010 ultimate installed in my system.
I've seen many of the posts were refering to openCV 2.3.0 instead of 2.3.1 and i downloaded both to see if i could make it work but had the same result: no success.
I was particularly persistent with Stampede's example here.
What i did so far:
- after running without any success the examples and suggestions, unistalled and deleted (from folders and PATH) my previous QtSDK and openCV
- reboot
- installed qt (default installation option) in c:\Programming\Qt\SDK;
- extracted opencv to c:\Programming\ and added the following to the PATH variable:
C:\Programming\openCV\include
C:\Programming\openCV\include\opencv
C:\Programming\openCV\build\x86\mingw\bin
(i did this by this order. my first questions: is there a problem with it? should i do it the other way around? which paths are the ones i really need? are this ones too many, too few?)
- downloaded stampede's example from his post and opened it.
- first i just runned the code and as expected got an error:
C:\Programming\Qt\SDK\workspace\QtCvExample\src\h\ ImageCapture.h:16: error: C1083: Cannot open include file: 'cv.h': No such file or directory
(next question: is this header missing error due to the differences in the .pro file or is there any modification i should do to make it work just at this point?)
- assuming it is because of the .pro file i tried to make some changes in the .pro file to match my directories as everyone says. but here i encounter my first big problem. in the original .pro i find:
win32 {
CV11_INCLUDE = C:/OpenCV
CV11_LIB = C:/OpenCV/lib
CV22_INCLUDE = C:/OpenCV2.2/modules
CV22_LIB = C:/OpenCV2.2/build/bin
} else{
CV11_INCLUDE = /usr/local/include/OpenCV
CV11_LIB = /usr/local/lib/OpenCV
CV22_INCLUDE = /usr/local/include/OpenCV2.2
CV22_LIB = /usr/local/lib/OpenCV2.2
}
i think i should replace this for something like:
CV22_INCLUDE = C:/OpenCV2.2/modules
CV22_LIB = C:/OpenCV2.2/build/bin
but with the correct pathways because i'm working on windows.
When i open C:/Programming/openCV to search for similar directories, i can easily find the modules and build directories. but inside the build there's no bin folder (please see the attached image to see the folders i have in the build folder). i tried to set this paths to:
CV22_INCLUDE = C:/Programming/openCV/modules
CV22_LIB = C:/Programming/openCV/build/x86/mingw/bin
is this the correct approach?
at this point i tried to run the program and i still have the same error about not finding cv.h
i figure i need to change some more things in the .pro file. changing:
contains(cv,2){
message(build with opencv 2.2)
DEFINES += OPEN_CV_22
INCLUDEPATH += $$CV22_INCLUDE/core/include/opencv2/core \
$$CV22_INCLUDE/highgui/include/opencv2/highgui \
$$CV22_INCLUDE/imgproc/include/opencv2/imgproc \
$$CV22_INCLUDE/core/include \
$$CV22_INCLUDE/imgproc/include
LIBS += -L$$CV22_LIB
LIBS += -lopencv_highgui220 -lopencv_core220 -lopencv_imgproc220
} else{
message(build with opencv 1.1)
DEFINES -= OPEN_CV_22
INCLUDEPATH += $$CV11_INCLUDE/cv/include $$CV11_INCLUDE/otherlibs/highgui $$CV11_INCLUDE/cxcore/include
LIBS += -L$$CV11_LIB
LIBS += -lcv -lhighgui -lcxcore
}
to:
contains(cv,2){
message(build with opencv 2.2)
DEFINES += OPEN_CV_22
INCLUDEPATH += $$CV22_INCLUDE/core/include/opencv2/core \
$$CV22_INCLUDE/highgui/include/opencv2/highgui \
$$CV22_INCLUDE/imgproc/include/opencv2/imgproc \
$$CV22_INCLUDE/core/include \
$$CV22_INCLUDE/imgproc/include
LIBS += -L$$CV22_LIB
LIBS += -llibopencv_highgui231 -llibopencv_core231 -llibopencv_imgproc231
} else{
message(build with opencv 1.1)
DEFINES -= OPEN_CV_22
INCLUDEPATH += $$CV11_INCLUDE/cv/include $$CV11_INCLUDE/otherlibs/highgui $$CV11_INCLUDE/cxcore/include
LIBS += -L$$CV11_LIB
LIBS += -lcv -lhighgui -lcxcore
}
(i browsed all the folders for the INCLUDEPATH variable and everything made sense, and in the LIBS variable, since this version is different from 2.2.0, names changed)
i run the program again and again i find the same error. no cv.h found.
i'm starting to think that the system PATH is wrong but i have no ideas.. what am i doing wrong?
:S
Bookmarks