Author Topic: executables when compiling C++  (Read 3618 times)

Offline tejashs

  • Single posting newcomer
  • *
  • Posts: 3
executables when compiling C++
« on: February 14, 2011, 02:34:51 am »
Hello guys i am just learning C++.
I am using the latest code::blocks 10.05, and when compiling c++ files i noticed that all the executables were more than 900Kb in size even though it is only a hello world program.
Is it only my problem or is it the normal behaviour.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: executables when compiling C++
« Reply #1 on: February 14, 2011, 06:28:35 am »
Normal. Play with the compiler options to reduce size.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline tejashs

  • Single posting newcomer
  • *
  • Posts: 3
Re: executables when compiling C++
« Reply #2 on: February 14, 2011, 12:48:30 pm »
Code
#include <iostream>
int main()
{
    std::cout << "hello world";
}

this is the code used and after trying optimizations for size,(888Kb to 457Kb) it reduced by half
can i further reduce it by any means

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: executables when compiling C++
« Reply #3 on: February 14, 2011, 04:38:41 pm »
can i further reduce it by any means
Depends on your compiler, but is certainly not related to C::B.

Please respect our forum rules and ask in a appropriate (compiler) forum. Thank you.

BTW: With terrabytes available these days why everybody is concerned about a few kB... :shock:
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ