[SOLVED][ERROR] [HELP] Using Qt + OpenCV to get what does webcam see
-
You are not linking to the OpenCV libraries
-
Do you mean in XXX.pro file ?
-
Yes indeed, in you project pro file
-
@OPENCV_PATH = /usr/local/include/opencv2/
LIBS_PATH = /usr/local/include/opencv/
LIBS += -L$$LIBS_PATH
-lcv
-lhighgui
-lcxcoreINCLUDEPATH += $$OPENCV_PATH/core
$$OPENCV_PATH/highgui/@This is how my linking look like
-
Are you sure you are linking to all the needed libraries ?
-
no, i am nt sure, but i checked many times if i left out any.
Should not be left out...
if this is not left out of libraries, what is the problem ? -
Just a missing library. You can check with pkg-config what you need. You can even use it within your pro file (have a look at qmake's documentation)
-
Ok. I give it a try and looh. Thx a lot SGaist
-
[quote author="SGaist" date="1403731430"]Just a missing library. You can check with pkg-config what you need. You can even use it within your pro file (have a look at qmake's documentation) [/quote]
Don't really know how to do....
I just have a look at the qmake genarated makefile. The INCPATH inside should be the openCV path ? It is different.
the another thing to mention is, after i qmake project, my Dialog.pro file will changed. the coding will all replaced.i am new to Qt and OpenCV, i just could not link them up.
Thanks to SGaist again,
-
Hi SGaist,
Finally I did it!
I make a slightly change in "qmake.conf" file which is under @/usr/share/qt4/mkspecs/default/qmake.conf@
I added in the INCLUDEPATH and LIBS.
Then it Works!! -
Don't modify that file, that will make all your projects link to OpenCV. Just correct your pro file with what you added there.
-
Hi SGaist,
I don't get what you mean,
Showing what camera get is only a part i need to do,I need openCV in my whole project, I need to do a Robot Vision System GUI,
so, I still not suggested to modify that file? -
Modifying /usr/share/qt4/mkspecs/default/qmake.conf means that every new project you'll create will be linked to OpenCV which is not a good idea.
Just move what you added in qmake.conf in your project's pro file
-
Dear YDYD sir,
i am new in QT. I also want to start a camera and want a image capturing and video recording functionality. I already triend the example which is given on official webside. But it showing multiple errors in header file. consider there are two header file. first is "one.h" and second is "second.h". In one.h,second.h is included. One.h is included in my application. At first it gives error for one.h. For solving this error i locate that file and add it in "#include </path/one.h>" then it solve the problem. But it shows error for second.h and header files which is included in that. One time i add path for all this error. It solves it but it then shows error in the functions of this header file. Sir i dont know what to do now. So can you send me the demo application to me to my mail id "dangat123suraj@gmail.com" and suggest solution for this problem. Thanking you in advance.