mingw-w64 / mingw-w64.github.io

mingw-w64.net web page contents (The new web page)
Other
599 stars 1.34k forks source link

Compiled file gets heavier and heavier #50

Open AlexandrPutenikhin opened 9 months ago

AlexandrPutenikhin commented 9 months ago

[Windows 10, x86_64] https://file.garden/ZB1peNEMpVTUWaAO/mingw The forest1.exe was compiled yesterday. The forest2.exe was compiled today. I remember that it weighted around 45 Kib. I did not add add anything. I also compiled the same code on my school's computer and it weighted even more. Please help

TJ-develops commented 2 months ago

Ensure that the compiler settings are identical on both your machine and the school's machine.
Make sure you're using the same MinGW version on both systems. Different versions can produce different executable sizes. Also, debug information can significantly increase the size of your executable. Make sure you are compiling without debug info for the release version. You can do this by adding the -s flag to the linker, which strips debugging symbols. For example: gcc -Os -s -o forest.exe forest.c