statically linked executable
hi all,
i would like to know, what i have to do in order to get an exe-file, which i can run on a machine without Qt.
as far as i know this is what is called "statically linked", isn't it?
(i have only the free version of Qt)
thanks for any suggestion
smalls
Re: statically linked executable
yes it is:)
in dymic linked mode you must have qt-mtblablabla.dll with your *.exe
Re: statically linked executable
so which of the dll's do i have to redistribute with my app?
(some of them are really big)
where should they be placed?
and is it possible, to link them statically, so that i needn't to have the dll's with the app?
Re: statically linked executable
Quote:
Originally Posted by smalls
so which of the dll's do i have to redistribute with my app?
In most cases you'll need QtCore4.dll QtGui4.dll and your compiler's dll (mingwm10.dll for you know which compiler) but in order to get a definite answer you should see which modules you use in your app and include the neccessary dlls (eg if you're using xml you'll need QtXml4.dll if you're using OpenGl you'll need QtOpenGL4.dll etc).
Quote:
Originally Posted by smalls
where should they be placed?
In your program's working dir, or in [WINDIR]/system32 with the later being a very bad choice leading to dll hell most of the times.
Quote:
Originally Posted by smalls
and is it possible, to link them statically, so that i needn't to have the dll's with the app?
yes
Re: statically linked executable
what's up with linux? i'm building a live cd with a qt4-app and installed the qtlibs to do this (dynamically linked). I've read you need to recompile QT to get a static version. Is this really the only way if you're using linux?
Re: statically linked executable
including the core libs boosts the size of my app....
how do i link it statically?
i guess this won't inflate the size that much, cause i think then only the parts are included which are really needed.... but maybe i am wrong.
nevertheless, can someone tell me how to link it statically, such that i dont need the qt dlls on the target system?
Re: statically linked executable
Quote:
Originally Posted by smalls
including the core libs boosts the size of my app....
how do i link it statically?
i guess this won't inflate the size that much, cause i think then only the parts are included which are really needed.... but maybe i am wrong.
nevertheless, can someone tell me how to link it statically, such that i dont need the qt dlls on the target system?
You need to compile staically your application with settings in compiler.
I use MSVC.net so this options availible in the project settings
Re: statically linked executable
i've got only the standard compiler that comes with free Qt, (mingw or something like that).
anyone know how to link statically in that case???
Re: statically linked executable
well, finally i found some informations about how to link statically...
http://doc.trolltech.com/qq/qq10-win...eployment.html
i followed the instructions but i didn't include any additional libraries, so i wasn't wondering, that the exe still did not work on a machine without Qt. some dll was missing (and it was some mingw specific dll)... and the size of my app grow up to over 70 (seventy) MB. where as the dynamically linked version used to be about 1 (one) MB...
so i will switch back to dynamically linking and i will found out which dll's to redistribute with my app, when i'm going to give it to somebody...