By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,017 Members | 997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,017 IT Pros & Developers. It's quick & easy.

File size difference under different compilers.

P: n/a
Hello,
I do a experiment on compile one file using different compilers.I got the
results below:
Output file1: hello1 14,332Byte under C-free
Output file2: hello2 4,096Byte under Dev-C++
Output file3: hello3 57,344Byte under Microsoft Visual C++ Express
2005
Why does these files vary so large?
Is there any method and tools of analyzing these .EXE files to see its
difference?
CSS
Aug 22 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Chen Shusheng" <ly*******@hotmail.tomwrote in message
news:Ql********************@wagner.videotron.net.. .
Hello,
I do a experiment on compile one file using different compilers.I got the
results below:
Output file1: hello1 14,332Byte under C-free
Output file2: hello2 4,096Byte under Dev-C++
Output file3: hello3 57,344Byte under Microsoft Visual C++ Express
2005
Why does these files vary so large?
Is there any method and tools of analyzing these .EXE files to see its
difference?
CSS
What compiler switches did you use? Were they all in debug or release?
Etc... There are quite a bit of factors that can effect an executable size,
and all compilers are not created equal.

Reguardless, I would say on the MS VC++ Express you compiled in debug mode,
which adds code, and a few other settings that can bloat code.
Aug 22 '06 #2

P: n/a
Chen Shusheng wrote:
Hello,
I do a experiment on compile one file using different compilers.I got the
results below:
Output file1: hello1 14,332Byte under C-free
Output file2: hello2 4,096Byte under Dev-C++
Output file3: hello3 57,344Byte under Microsoft Visual C++ Express
2005
Why does these files vary so large?
Is there any method and tools of analyzing these .EXE files to see its
difference?
Why do you care?

The difference may appear large with a single file, but end up being
insignificant on a real application.

--
Ian Collins.
Aug 22 '06 #3

P: n/a
Chen Shusheng wrote:
Hello,
I do a experiment on compile one file using different compilers.I got the
results below:
Output file1: hello1 14,332Byte under C-free
Output file2: hello2 4,096Byte under Dev-C++
Output file3: hello3 57,344Byte under Microsoft Visual C++ Express
2005
Why does these files vary so large?
Is there any method and tools of analyzing these .EXE files to see its
difference?
CSS

In the two large cases you most likely are getting static linked
copies of the RunTime libraries (i.e., the entire startup, memory
allocation, io system, everything that is referred to in your
program). For the smallest one, you are most likely using dynamic
runtimes (DLL's for the case of Windows, shared libraries for
UNIX). The program size is just about the same, except that
the code lives in other modules than your exe.
Aug 22 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.