Results 1 to 4 of 4

Thread: Very Strange Thing...

  1. #1

    Thread Starter
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    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?
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  3. #3

    Thread Starter
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    No i am compiling as Win32 Release.As debug it is 450KB large.Can i make it smaller in some way or not.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    ...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
  •  



Click Here to Expand Forum to Full Width