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

Nikolay Moskvichev nikolay.moskvichev at gmail.com
Wed Apr 1 11:30:12 CEST 2009


Hello, Jeroen Wijnhout
01.04.2009 13:31 you wrote:
> 2009/3/28 James Yan <jyan972 at gmail.com>:
>> Hey all,
>>
>> recently, i try to move my IDE from Visual C++ Express( win32-msvc ) to Qt
>> Creator ( win32-g++ ) for my Qt app building, now everything works ok, i
>> love the feel to get rid of VC++ and switch to qt creator, but i found a
>> problem on complied files size, under the same pro file and source files (
>> both in release mode and using static qt lib 4.4.3 )
>> Visual C++ Express 2008 (win32-msvc) : 3,976 kb
>> Qt Creator (win32-g++)                         : 10,305 kb
>> is there anything i can fix? or it's just normal with mingw complier?
> 
> Note that MSVC usually has the debugging information in a separate
> file, while GCC includes it in the binary. This could account for the
> difference. However in release mode, in my experience, the GCC build
> is smaller compared to the MSVC build. This is using GCC on Linux, but
> I don't expect to make that much of a difference. So, if this is a
> release build, then the results seem really odd to me.
> 

test.cpp:

#include <iostream>
int main()
{
    std::cout<<"Hello, world!";
    return 0;
}

F:\temp>g++ -v
Using built-in specs.
Target: mingw32
...
gcc version 4.3.3 (4.3.3-tdm-1 mingw32)

F:\temp>g++ test.cpp
F:\temp>dir a.exe
....
01.04.2009  15:25           875 166 a.exe

F:\temp>strip a.exe
F:\temp>dir a.exe
....
01.04.2009  15:26           442 368 a.exe

F:\temp>cl /?
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 
for 80x86

F:\temp>cl test.cpp
F:\temp>dir test.exe
...
01.04.2009  15:29           110 592 test.exe



More information about the Qt-interest-old mailing list