title: How to reduce the size of executable produced by MinGW g++ compiler?
body: <p>I have a trivial "Hello world" C++ program that is compiled to 500kB executable by MinGW g++ compiler under Win XP.
  Some say that is caused by <strong>iostream</strong> library and static link of <strong>libstdc++.dll</strong>.</p>
  
  <p>Using <strong>-s</strong> linker option helped a bit (reducing 50% size), but I would by satisfied only by &lt;10kB executable. Is there any way how to achieve this using MinGW compiler? Portability is not a big concern for me.</p>
  
  <p>Is it possible to copy libstdc++.dll with the executable using dynamic linking? If so, how to achieve this?</p>
  
  <hr>
  
  <p><strong>Solved:</strong> I was using MinGW 3.4. Now I updated to latest MinGW 4.6 and the size was decreased by 90% to 50kB, with <strong>-s</strong> option even to 9kB, which is fully sufficient. Anyway - thanks everyone for help. Here you go my results</p>
  
  <p><strong>C++ <em>Hello World</em> program using iostream</strong></p>
  
  <pre><code>MinGW | no options | -s option
  ------------------------------
  3.4   | 500kB      | 286 kB
  4.6   | 50kB       |   9 kB
  </code></pre>