PDA

Click to See Complete Forum and Search --> : Very Strange Thing...


Vlatko
Oct 9th, 2000, 03:28 PM
I am making a kind of a notepad app(no MFC).I use this to open a file:

#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?

parksie
Oct 9th, 2000, 05:45 PM
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.

Vlatko
Oct 10th, 2000, 05:19 AM
No i am compiling as Win32 Release.As debug it is 450KB large.Can i make it smaller in some way or not.

parksie
Oct 10th, 2000, 01:45 PM
...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.