Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

#include <string> adding ~43 KB to my exe

I'm using Code::Blocks to write my program and when I include <string> (or <iostream>) the size of my exe grows. My program is very simple and I need to keep it small <20kb. I'm pretty sure this is happening because of the C++ Standards Committee swapped the old .h versions for many new libraries without the .h. But how would I keep it from adding the ~43kb? Are there settings for Code::Blocks so that it wont add the extra kb or is there another native lib I can use?

like image 706
Lienau Avatar asked May 24 '26 11:05

Lienau


1 Answers

If size is your #1 concern (and if you have to keep things < 20KB, then it probably is) then the standard C++ library is probably not the way to go. In fact, any C++ at all (RTTI, exceptions, etc) is probably a bad idea and you would be better off just sticking with straight C.

like image 196
Dean Harding Avatar answered May 26 '26 00:05

Dean Harding



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!