compile a code

hi
i have a code and a compiled example of that
the file size is 6kb and it doesn't need c++ runtime to run
but when i compile that code myself, size going to 30 kb and it need c++ runtime
what's my wrong?
sorry for my eng
Last edited on
closed account (zb0S216C)
The compiler is free to add additional information prior to or during compilation. Inline functions and macros, for example, contribute to the final size of the executable. Headers, templates, exception handling, RTTI and debugging information also contribute to the final size of a program. Compilers can optimize your code to reduce the overall size, as well as other optimization's.

If you're using MinGW's compiler, investigate UPX[1].

References:
[1]http://upx.sourceforge.net/


Wazzak
Last edited on
also, use:
--static-libstdc++
when compiling

It won't say c++ runtime needed then.
Last edited on
Topic archived. No new replies allowed.