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

Jeroen Wijnhout jeroen.wijnhout at gmail.com
Wed Apr 1 14:26:55 CEST 2009


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
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).

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

best,
Jeroen




More information about the Qt-interest-old mailing list