3 Attachment(s)
Mixing static and dynamic libraries using Qt Creator
I have a static Qt build. I am trying to use openCV shared libraries with statically linked Qt and standart c libraries. I couldn'yt figure how to do that.
Here is my .pro fileAttachment 10952
If i compile this code: Attachment 10953
resulting .exe works correctly without asking any .dlls.
But if i use openCV library and compile this code:
Attachment 10954
resulting .exe asks for both "libopencv_core2410.dll" and other standart libraries like "libgcc_s_dw2-1.dll"
What i want is make it ask only for opencv shared libraries. Any help will be appreciated. Sorry for my bad English. :)
Re: Mixing static and dynamic libraries using Qt Creator
You can't do that unless you compile the c++ runtime from MinGW statically into the opencv dll. Which is probably out of scope of this forum.
Re: Mixing static and dynamic libraries using Qt Creator
Thanks! I've compiled opencv statically and problem was solved.
Re: Mixing static and dynamic libraries using Qt Creator
Hi, can you explain how you static compile opencv for qt. In cmake when i set BUILD_SHARED_LIBS=off i got this error Make Error at apps/haartraining/CMakeLists.txt:37 (add_library):
Target "opencv_haartraining_engine" links to itself.
And then in vs when i compile opencv i got lot of this errors:
Quote:
Error 45 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QMutex::QMutex(enum QMutex::RecursionMode)" (__imp_??0QMutex@@QAE@W4RecursionMode@0@@Z) referenced in function "void __cdecl `dynamic initializer for 'mutexKey''(void)" (??__EmutexKey@@YAXXZ) C:\ocv\myocv\apps\annotation\opencv_highgui2411.li b(window_QT.obj) opencv_annotation
I use staticly compile Qt 5.4.1 with mingw32 and opencv 2.4.
Thanks for any help