PDA

View Full Version : Build without any dependencies



Dato0011
22nd December 2009, 10:35
Hello

I'd like to build a small executable without any dependencies, including qt. Is it possible with QtCreator + MinGW?

P.S. I don't mean linking qt statically, I just don't need qt libraries in this case. But maybe I'll need to link MinGW dependencies statically.

Thanks

high_flyer
22nd December 2009, 11:54
Yes, just select an empty Qt project in creator.

Dato0011
22nd December 2009, 12:10
Thanks flyer

Qt dependency is fixed, but now how can I build it statically? I mean, when i run the built exe, it gives an error libgcc_s_dw2-1.dll is missing.

high_flyer
22nd December 2009, 13:07
Is your creator configured to work with MinGW?
It sounds like the MinGW configuration is broken, but I can't tell, I am working with msvc as a compiler for my creator, maybe some one else who uses MinGW can help you more.

Dato0011
22nd December 2009, 14:44
Thanks flyer :)

BTW Dev C++ compiled exe is not dependent on libgcc_s_dw2-1.dll (with mingw). but when i compile from qtcreator with mingw it does.
I prefer to use QtCreator ide, but don't want that libgcc_s_dw2-1.dll dependency. Anyone has any idea?

nateriver
22nd December 2009, 15:21
I prefer to use QtCreator ide, but don't want that libgcc_s_dw2-1.dll dependency. Anyone has any idea?

That library is responsible for new exception model ("DWARF" as long as I remember) used in gcc 4.4, which is not yet included in standard mingw, but included in mingw bundled with qt (since 4.6). If you try to compile your app using standard mingw and try to link it to qt 4.6 you'll get unresolved symbols for aforementioned reason.
So if you really want to use Qt 4.6 on Windows without that dependencies you will need to fully compile Qt itself using standard mingw (or maybe MSVC) I suppose.

P.S. I may be wrong ;)