Why does iostream take so much flash space on an MCU?
问题 I use GCC 5.2.0 to compile code for an EFM32 MCU (based on a Cortex-M core). I notice an awful increase in code size when I want to #include <iostream> . For example, let's compile the following code for an EFM32WG "Wonder Gecko" chip: #include "em_device.h" #include "em_chip.h" #include <iostream> int main(void) { CHIP_Init(); while (1) { } } This code will result in 172048 bytes of code, whereas without #include <iostream> it is only 1440 bytes. I usually just use cout for debug output (by