+ 4
MinGW g++
I compile my cpp code from command prompt with g++, but I can't run the code because libstdc++ and libgcc libraries are missing. I tried to use the -static-libstdc++ and -static-libgcc flags but I get a 2000kb size file (at least runs). Some help here? [Re-posted the question because nobody answered. Deleted the old one]
4 Answers
+ 8
I think the codes I compiled using DevC++ were also around 1-2MBish. Not really sure about your case.
I've searched about reducing executable size,
https://stackoverflow.com/questions/7973274/how-to-reduce-the-size-of-executable-produced-by-mingw-g-compiler
Maybe try updating/clean reinstalling if nothing works?
+ 1
my code was a hello world program, with iostream
i made one with stdio and got a normal result, ~40kb
i saw it's because iostream has some includes such as string, with vectors that have templates and the code gets big, but 2000kb is very big for a hello world!
+ 1
i also saw i may use the -Os flag and then 'strip' the exe
+ 1
I'm wondering because it never happened with dev-c++... Am not I using the same compiler? Its weird