News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

executables when compiling C++

Started by tejashs, February 14, 2011, 02:34:51 AM

Previous topic - Next topic

tejashs

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.

MortenMacFly

Normal. Play with the compiler options to reduce size.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

tejashs


#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

MortenMacFly

Quote from: tejashs on February 14, 2011, 12:48:30 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]