|
-
Oct 9th, 2000, 03:28 PM
#1
Thread Starter
Frenzied Member
I am making a kind of a notepad app(no MFC).I use this to open a file:
Code:
#include <string>
#include <fstream>
using namespace std;
....
string all,got;
ifstream in(filename); //this
while(getline(in,got))//this
{
all += got + "\r\n";//this
}
SendMessage(e,WM_SETTEXT,0,(LPARAM)all.c_str() );
The lines marked "//this" make my app 120 KB bigger.(from 36 to 156 KB)
Why is this happening?
-
Oct 9th, 2000, 05:45 PM
#2
Monday Morning Lunatic
Because you're bringing in the iostream libraries. Are you compiling as Win32 Debug by any chance? The Standard C++ Library causes the MSVC++ compiler to churn out loads of debug info.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Oct 10th, 2000, 05:19 AM
#3
Thread Starter
Frenzied Member
No i am compiling as Win32 Release.As debug it is 450KB large.Can i make it smaller in some way or not.
-
Oct 10th, 2000, 01:45 PM
#4
Monday Morning Lunatic
...One check later...
It's a slight issue with the iostream libraries that MS supply - they can often make your app pretty big. Try playing around with the optimisation settings.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
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
|