Author |
Message |
haskell
|
Posted: 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  |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
[Gandalf]

|
Posted: 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.  |
|
|
|
|
 |
haskell
|
Posted: 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]

|
Posted: 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?  |
|
|
|
|
 |
haskell
|
Posted: 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

|
Posted: 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

|
Posted: 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
|
Posted: Fri Dec 29, 2006 12:44 am Post subject: (No subject) |
|
|
For me, Hello World compiles to 7.8Kb using gcc. |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
wtd
|
Posted: 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

|
Posted: 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

|
Posted: 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

|
Posted: 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
|
Posted: 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

|
Posted: Fri Dec 29, 2006 12:18 pm Post subject: (No subject) |
|
|
no, I dont use the optimize option |
|
|
|
|
 |
wtd
|
Posted: Fri Dec 29, 2006 12:20 pm Post subject: (No subject) |
|
|
Perhaps you could post the offending source code. |
|
|
|
|
 |
|