|
-
Sep 22nd, 2006, 04:45 AM
#1
Thread Starter
Junior Member
<iostream> and Execuable Size
OK, before adding "#include <iostream>" to my program, the file size is 23kb, after adding it, the file size is over 450kb, is that normal??
-
Sep 22nd, 2006, 04:49 AM
#2
Re: <iostream> and Execuable Size
I assume you mean compiled file size, in which case the answer is yes.
-
Sep 22nd, 2006, 04:53 AM
#3
Thread Starter
Junior Member
Re: <iostream> and Execuable Size
Fark, why the hell is that?
-
Sep 22nd, 2006, 05:02 AM
#4
Re: <iostream> and Execuable Size
Well, because include means just that - it includes whatever is in your standard library's iostream header file (and any files #include'd from that, etc.) as if it were part of your source code.
All convenience comes at a price.
-
Sep 22nd, 2006, 05:10 AM
#5
Thread Starter
Junior Member
Re: <iostream> and Execuable Size
Heh, I realised that, I was just wondering why it was such a huge file. What functionality is included in the iostream header anway?
-
Sep 22nd, 2006, 05:17 AM
#6
Re: <iostream> and Execuable Size
-
Sep 22nd, 2006, 05:42 AM
#7
Thread Starter
Junior Member
Re: <iostream> and Execuable Size
Thanks. Looks like I'll be avoiding this particular header in this application, i need it to be as small as possible.
-
Sep 22nd, 2006, 10:51 AM
#8
Re: <iostream> and Execuable Size
Bah!
Btw, including the header should increase your exe by exactly nothing. It's using something from it, like std::cout, that increases the size.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Sep 26th, 2006, 11:43 AM
#9
Frenzied Member
Re: <iostream> and Execuable Size
No way in hell the app should be 450kb using everything IN <iostream>
Are you sure you're reading 450kb and not 45.0 kb ?
-
Sep 26th, 2006, 12:07 PM
#10
Re: <iostream> and Execuable Size
450k is realistic. The default setting is to link statically.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Sep 26th, 2006, 12:16 PM
#11
Frenzied Member
Re: <iostream> and Execuable Size
Humm. OK every app I've ever coded using <iostream> and mainly cout is always between 40kb and 80kb max. How can it grow to over 400kb?
Say you have, I dunno, 5 primary functions you use out of <iostream> throughout your app. Doesn't your program use the same code (say a pointer) to refer back to those same functions, even though you may reference those functions multiple times? Or if you have a LOT of code I could see the app getting big.
I don't see how simply using a few functions from <iostream> can bloat it that badly unless you're configured for Debug.
I love having gurus to explain this stuff.
-
Sep 26th, 2006, 01:57 PM
#12
Re: <iostream> and Execuable Size
I think it might be Debug ...
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Sep 26th, 2006, 04:23 PM
#13
Thread Starter
Junior Member
Re: <iostream> and Execuable Size
Yeah, it is debug. 
But I've noticed something else now, when I compile a certain project under VC++ under debug, its about 200kb, when I compile it under release, it's about 100kb. But when I compile it with Dev-C++ it's about 14kb, and then when I compile it with the VS Command Prompt it's 4kb. Why are they all different sizes when they all function the same way?
-
Sep 27th, 2006, 04:50 AM
#14
Re: <iostream> and Execuable Size
Your project settings might by default be different than the settings at the command line. Also, Dev-C++ uses a completely different compiler.
In the project settings, there should be a place where you can find the complete command line for compiler and linker. Use these, and see if the binary is the same size. Then you can try optimizing it.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Sep 27th, 2006, 05:12 AM
#15
Thread Starter
Junior Member
Re: <iostream> and Execuable Size
Yeah, I checked, its using heaps of options, and I'm just using one or two. All those options are making the file size a lot larger.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|