Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 454 kb Hello world program!!
Index -> Programming, C++ -> C++ Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
haskell




PostPosted: Wed Dec 27, 2006 8:01 pm   Post subject: 454 kb Hello world program!!

Yeah lol... So I think I busted my compiler(fixed it by getting a fresh of GCC).

It compiled my mid-sized app to 30 kb, but a hello world program to 454 kb:shock: .

I think it was iostream and the STL that caused it for me.

No, I don't want help, I was just wondering if anyone has experienced anything similar lol. It is pretty funny Very Happy
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Wed Dec 27, 2006 8:11 pm   Post subject: (No subject)

Yep. I've noticed a significant change in file size mostly based on what compiler you're using. For example, with GCC a terminal based hello world program might be a few hundred KB, but using VC++ the equivalent program is 5 KB and a simple GUI program is 15 KB. Never really done much exploring into it, seeing as how I have no shortage of storage space. Wink
haskell




PostPosted: Wed Dec 27, 2006 8:16 pm   Post subject: (No subject)

Interesting. I'm looking at OpenWatcom as a replacement for GCC, just because of this retarded overhead that seems to be common. I got 40 kb for a helloworld a couple days ago.

I can't wait to get my Intel C++ compiler lol -.-.
[Gandalf]




PostPosted: Wed Dec 27, 2006 8:31 pm   Post subject: (No subject)

Note that I still prefer to use GCC over Microsoft's compiler for non-GUI programs.

What harm are a few extra KB going to cause? Smile
haskell




PostPosted: Wed Dec 27, 2006 8:45 pm   Post subject: (No subject)

I prefer using a visual resource editor and GCC for GUI apps, but each to his own I suppose. Its just as easy, if not easier... If you want I can show some examples of resources in apps using GCC?

And it just bugs me. I am still a low-level programmer at heart... I used to program full scale apps in MASM32 and FASM(Two assembly dialects), and program highly optimized C code in LCC. So, any extra memory usage or performance loss that I don't deem proper, I get pretty picky lol...

So yeah... That few KB eats at me... Annoys me... It burns! GET IT OFF!!!!!
bugzpodder




PostPosted: Thu Dec 28, 2006 10:06 pm   Post subject: (No subject)

i built a 150-ish C++ program with STL headers... this shockingly was over 20MB with g++ 4...
md




PostPosted: Thu Dec 28, 2006 10:35 pm   Post subject: (No subject)

I have a ~2400 line app; it compiles to 812K for the client, 792K for the server and oddly 812K for both combined.

If anyone wants to see the size of the relevant msvc++ executables the code is at svn://svn.nxor.org/vnet/
neufelni




PostPosted: Fri Dec 29, 2006 12:44 am   Post subject: (No subject)

For me, Hello World compiles to 7.8Kb using gcc.
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Fri Dec 29, 2006 12:54 am   Post subject: (No subject)

The question I would ask is whether or not you know how the STL works.
bugzpodder




PostPosted: Fri Dec 29, 2006 10:52 am   Post subject: (No subject)

yes, its a template library, so it essentially is a template, ie put your code in theirs. But 20MB by god is a large app
Mazer




PostPosted: Fri Dec 29, 2006 11:07 am   Post subject: (No subject)

Can you guys give me some tips? I must be going about this the wrong way because I'm putting "using namespace std;" in all of my source files and g++ won't give me more than 86KB.
Clayton




PostPosted: Fri Dec 29, 2006 11:12 am   Post subject: (No subject)

Has anyone recently tried to download MinGW? I've been trying to download it to my laptop, but it continually stops halfway through with the installation/downolad and it's getting very annoying.
wtd




PostPosted: Fri Dec 29, 2006 11:29 am   Post subject: (No subject)

bugzpodder wrote:
yes, its a template library, so it essentially is a template, ie put your code in theirs. But 20MB by god is a large app


Every time you instantiate a template with a different set of values or types, new code gets generated.

Are you telling the compiler to optimize?
bugzpodder




PostPosted: Fri Dec 29, 2006 12:18 pm   Post subject: (No subject)

no, I dont use the optimize option
wtd




PostPosted: Fri Dec 29, 2006 12:20 pm   Post subject: (No subject)

Perhaps you could post the offending source code.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 18 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: