473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

File size difference under different compilers.

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
3 1734
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Sebastian Kemi | last post by:
How should a write a class to a file? Would this example work: object *myobject = 0; tfile.write(reinterpret_cast<char *>(myobject), sizeof(*object)); / sebek
40
by: Abby | last post by:
My .dat file will contain information like below. /////////// First 0x04 0x05 0x06 Second 0x07
17
by: Joe Laughlin | last post by:
I've not used C much before, so I don't know how robust or good this code is. I'd appreciate any feedback or criticisms anyone has! Thanks, Joe #include <stdio.h> #include <string.h>
35
by: Sunil | last post by:
Hi all, I am using gcc compiler in linux.I compiled a small program int main() { printf("char : %d\n",sizeof(char)); printf("unsigned char : ...
8
by: Greg Stoch | last post by:
Hi, I'm newcomer to Microsoft product (VS.net 7.0, C++) and need to understand, why the binary code obtained using VC++ compiler is so huge as compared to the code by Borland C++ 5.02 (the same...
9
by: paczkow | last post by:
Dear Python Community, I am an engineering and I am experiencing some trouble. Having output data from other software I want to use it. To achieve this I decided to use Python since this...
9
by: Tristán White | last post by:
Hi I am very new to PHP - actually, this is my second day at it, as I've only recently started a new job last week. We're a charity. I have a "No input file selected" problem. A Google search...
111
by: Tonio Cartonio | last post by:
I have to read characters from stdin and save them in a string. The problem is that I don't know how much characters will be read. Francesco -- ------------------------------------- ...
20
by: Ashit Vora | last post by:
Hi, I 'm new to C programming and 'm stuck somewhere. I want to find the size of a file. I couldn't find a proper way of doing it. What I was planning to do is... Open the requested file,...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.