Menu

big compile size for small code

2002-09-16
2012-09-26
  • Nobody/Anonymous

    Ok.. check this out

    3 files.

    main.cpp
    silly.h
    silly.cpp

    //main()
    int main(int argc, char *argv[])
    {  
        return 0;  
    }

    //silly.h
    #ifndef _silly_h
    #define _silly_h
    class silly {
        public:
            int a_var;
            int b_var;
            silly();
           ~silly();
    };
    #endif

    //silly.cpp
    #include "silly.h"
    silly::silly(){}
    silly::~silly(){}

    // -------- //

    compile size = 20992

    Now THAT is far too big!

    I created a project and the three files are in the project directory and are also added to the project.

     
    • Nobody/Anonymous

      Right then..

      If I remove the default destructor ( silly::~silly(){} )the compile size drops to 3072 bytes.

      Surely a bug? Or I've done something extremely silly.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.