[Qt-interest] win32-g++ compiled Qt app much bigger than win32-msvc compiled one?

Nikolay Moskvichev nikolay.moskvichev at gmail.com
Thu Apr 2 04:54:20 CEST 2009


Hello, Jeroen Wijnhout
01.04.2009 18:26 you wrote:
> On Wed, Apr 1, 2009 at 11:30 AM, Nikolay Moskvichev
> <nikolay.moskvichev at gmail.com> wrote:
>> Hello, Jeroen Wijnhout
>> test.cpp:
>>
>> #include <iostream>
>> int main()
>> {
>>    std::cout<<"Hello, world!";
>>    return 0;
>> }
>>
> 
> I was only sharing my experience using both MSVC 2003 and GCC 3.4.x
> (on Linux). If MinGW results in bloated executables then that is very
> strange, since GCC doesn't.
> 
> Btw, your example only shows that MinGW has more overhead compared to
> MSVC, since the resulting code corresponding to printing "hello world"
> will be very small, using any compiler. Perhaps MinGW needs the

Yes, but in my expirience binaries builded by MinGW always bigger than 
binaries builded by MSVC.

> overhead to adapt to the Windows environment, in any case it is
> interesting to see such a difference.
> 
> My experience comes from an actual cross platform project containing
> +100.000 lines of code. Again using MSVC2003 and GCC 3.4.x. (same
> applies to GCC 4.x btw).
> 

You can compare Qt binaries sizes, compiled by MinGW and MSVC.

> Note that, if I compile the hello world example on Linux (GCC 4.3.2),
> then it is only 9.4Kb:
> g++ test.cpp
> ls -lh test.cpp
> -rwxr-xr-x 1 user group 9542 2009-04-01 14:17 a.out
> 

I think, if you call ldd on your a.out, it show you something like:

bash-2.05$ ldd a.out
         libstdc++.so.3 => /usr/lib/libstdc++.so.3 (0x40025000)
         libm.so.6 => /lib/libm.so.6 (0x400ca000)
         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x400ec000)
         libc.so.6 => /lib/libc.so.6 (0x400f6000)
         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

> best,
> Jeroen



More information about the Qt-interest-old mailing list