PDA

View Full Version : Qt cant work with opencv



danics
6th March 2010, 12:14
Hi everybody, i m a new programmer in Qt and OpenCv , i want create Qt application with OpenCv library but i cant use OpenCv in qt any more. i create a Qt Gui application (Qt 4.x) and i setup opencv2.0 too although i m not sure that it is a complete setup. i add this line to .pro file anyway :
INCLUDEPATH += C:/OpenCV2.0/include/opencv

win32:LIBS += "C:\OpenCV2.0\bin\libcv200.dll" "C:\OpenCV2.0\bin\libcvaux200.dll" "C:\OpenCV2.0\bin\libcxcore200.dll" "C:\OpenCV2.0\bin\libhighgui200.dll" "C:\OpenCV2.0\bin\libcxts200.dll" "C:\OpenCV2.0\bin\libml200.dll"

when i compile the program i get 17 errors with 17 warnings ,it is like that Lib files dont load and i haven't any idea please help me.

maybe my opencv must compile with cmake for Qt like Vs9 but i dont know what option sould select for that tanks again!

arpspatel
7th March 2010, 00:27
that is bcoz ur trying to compile with wrong libs.. try this

win32:LIBS+= "C:\OpenCV2.0\lib\libcv200.dll.a" "C:\OpenCV2.0\lib\libcvaux200.dll.a" "C:\OpenCV2.0\lib\libcxcore200.dll.a" "C:\OpenCV2.0\lib\libhighgui200.dll.a" "C:\OpenCV2.0\lib\libcxts200.dll.a" "C:\OpenCV2.0\lib\libml200.dll.a"

It should work

danics
7th March 2010, 10:57
Thank you so much for your reply but i test that before too and i get same errors:
cxoperations.hpp:1442: error: there are no arguments to `__exchange_and_add' that depend on a template parameter, so a declaration of `__exchange_and_add' must be available.
cxoperations.hpp:1442: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
cxmat.hpp:174: error: `__exchange_and_add' was not declared in this scope

and all errors is about _exchange_and_add from another library of opencv and i think my program cant load Lib files! please help me.

danics
7th March 2010, 11:09
my problem is solved i setup in my computer MINGW 4.x and i change line 68 in cxoperations.hpp from
#if __GNUC__ >= 4
to
#if __GNUC__ >= 4 || __MINGW32__

and myprogram is compile thats great!
Thanks so much!