PDA

View Full Version : windows static compiling - debug symbols



eleanor
29th December 2009, 10:37
Hi, I have compiled my QT on windows statically. All is fine and works, except the disk usage is around 3GB. I deleted temporary and garbage files using:

mingw32-make clean
but the compiled binaries are still taking up around 2.2GB of disk space.

Is there any way to further strip the unneeded things to free some more space (of course I still want to compile programs statically...).

I would be greatful for any ideas?

squidge
29th December 2009, 10:47
You can recompile Qt to remove things you don't use, then your programs will also shrink in size.

eleanor
29th December 2009, 19:12
No, I want all the functionality available, because you never know when you're gonna need it.

But the actual QT size in linux (dynamical) is around 300MB, why is windows static version 2.2GB?

Ah, then there is no change in lowering the disk usage (without losing the functionality)?

squidge
29th December 2009, 20:21
In your first post, you stated 'compiled binaries', hence multiple.

Now you seem to referring to a single executable.

Which is it? 2.2GB is indeed large for a single executable, if thats the case.

eleanor
30th December 2009, 09:06
Yes multiple compiled binary...

But on linux system they only occupy 300MB (dynmically compiled), but on windows they occupy 2.2GB (statically compiled).

So why is there so much difference in disk space usage?

squidge
30th December 2009, 09:30
On Linux, all the code your linking against is kept in a shared library. On Windows, because you are statically linking, all the code you are linking against is copied to each and every executable, thus making it substantially larger. It'll also use more memory, as the code can't be shared amongst processes.

You should dynamically link on Windows too, and your executable sizes will drop dramatically. There are very few reasons to statically link.

eleanor
30th December 2009, 18:40
I'm not talking about executables. I'm talking about statically compiled qt binaries ... so the question remains the same?

squidge
30th December 2009, 18:48
statically compiled qt binaries? Its compiled, thus executable, and since its statically linked, you can't be talking about the Qt library, so what are you talking about?