[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

questions about link

From: Chameleon
Subject: questions about link
Date: Thu, 18 Jan 2007 07:23:39 +0200
User-agent: Mozilla Thunderbird (Windows/20061207)

My project uses many libraries like libjpeg, libpng and more.
With all of these libraries linked statically and with many .cpp files
of my project, a big binary executable is predictable.

I'm impressed when I was remove the code inside 'main(...)' and all of
the includes, but executable size doesn't change, at all.

There are many *.cpp files but in test.cpp which implements 'main' there
is only this code:
int main(int argc, char **argv)
return 0;

size for this executable is about 290KBs and inside binary I recognize
parts of zlib library. I use zlib library in other .cpp file than
test.cpp, but I don't call anything from this file and if I remove it,
all work ok and size decreases.
If I remove all files except test.cpp, it compiles fine and size is 10KBs.

So the question is why linker include useless binary objects to final
binary executable.

My compiler/linker is mingw-g++, if does matter.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]