[Qt-interest] building static executables

Lorenzo Bettini bettini at dsi.unifi.it
Sun Jun 7 10:15:49 CEST 2009


actually, I'm using mingw to build programs that use qt in windows, 
while these crts look like visual studio specific...  so are they still 
required even if I use mingw?

thanks
	Lorenzo

Malyushytsky, Alex wrote:
> Forgot to mention, if you don't build QT statically, only additional libraries you have to deliver are dlls in QT bin folder your application is linked against.
> In the worst case you have to distribute them all.
> 
> Also QT online help provide much more detailed information about deploying applications on Windows than I could provide att
> 
> http://doc.trolltech.com/4.5/deployment-windows.html
> 
> Regards,
>    Alex
> 
> 
> 
> 
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Malyushytsky, Alex
> Sent: Friday, June 05, 2009 1:26 PM
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] building static executables
> 
> If you build QT statically you still would have to distribute CRT libraries WT is linked against.
> And you will have to make sure your application is linked against the same libraries too.
> If your problem is just to find the dependencies I advice you against linking Qt statically,
> because it does not give you expected (at least in Windows programming practice) results,
> and last time I checked was disabling a lot of QT features.
> 
> If you are using 3-rd party binaries on Windows, this will also bring compatibility issues.
> Under Windows you have to make sure that all of your code, 3rd party dependencies  including QT are linked against the same CRT libraries.
> It is a common practice that, if static library is provided, by default it is assumed to use static CRT libraries.
> If it is dll, it is linked against dynamic CRT libraries.
> You can create dll linked with static CRTs and static lib linked vs dynamic CRTs and that is what QT does when it is compiled statically, but this is at least uncommon.
> So currently (at least under Windows and MSVC) there is no any reason to link QT statically.
> You simply will not be able to get stand alone working executable.
> You will also have to distribute additional dlls - MSVC CRT libraries.
> 
> Which one to link against and distribute?
> 
> Detailed info can be found at:
> http://msdn.microsoft.com/en-us/library/abx4dbyh(VS.80).aspx
> 
> In short, the same as your QT4 version is built with.
> With pre-build QT you would probably need to use /MD flag and appropriate dlls from the link above ( msvcr80.dll MSVCP80.DLL ).
> 
> 
> Hope this helps,
> 
>  Alex
> 
> 
> 
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Lorenzo Bettini
> Sent: Friday, June 05, 2009 1:00 AM
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] building static executables
> 
> Malyushytsky, Alex wrote:
>> On Windows at least with MSVC, QT 4 does not support completely static builds because it will be still using dynamic CRTs.
>>
> 
> thus I should distribute also other dlls?
> If so, how could I know which ones to distribute?
> 
> thanks
>         Lorenzo
> 
>> Regards,
>>     Alex
>>
>> -----Original Message-----
>> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Lorenzo Bettini
>> Sent: Thursday, June 04, 2009 9:18 AM
>> To: qt-interest at trolltech.com
>> Subject: [Qt-interest] building static executables
>>
>> Hi
>>
>> If I need to build a static executable, completely static, is it just a
>> matter of adding
>>
>> CONFIG += static
>>
>> or should I have a version of qt itself built statically?
>>
>> thanks in advance
>>         Lorenzo
>>
>> --
>> Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
>> ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
>> HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
>> http://www.myspace.com/supertrouperabba
>> BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
>> http://www.gnu.org/software/src-highlite
>> http://www.gnu.org/software/gengetopt
>> http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>
>> ---------------------------------------------------------------------------------------------------
>> Weidlinger Associates, Inc. made the following annotations.
>>
>> "This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."
>>
>> "Please consider our environment before printing this email."
> 
> 
> --
> Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
> ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
> HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
> http://www.myspace.com/supertrouperabba
> BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
> http://www.gnu.org/software/src-highlite
> http://www.gnu.org/software/gengetopt
> http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> "This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> "This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."


-- 
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net




More information about the Qt-interest-old mailing list