Game Development Community

Why the compiled exe file bigger than orginal one ?

by ken · in Artist Corner · 10/09/2008 (11:18 am) · 6 replies

Hi there,
i open the solution the vc and build it with out any change then the exe file that create is bigger than the orginal one.
orginal = 1.8 mb
my exe = 4.8 mb
and sometimes it will crash !
wwwwhhhhyyyy ?

#1
10/09/2008 (11:35 am)
Likely you did a debug build instead of a release build.
#2
10/09/2008 (11:55 am)
I can't answer for the crash, but the compiler you use and it's settings play a factor in the final file size, also I do believe that GG compressed the original executable - UPX maybe.
#3
10/09/2008 (1:23 pm)
No , that's a release version !
#4
10/09/2008 (1:28 pm)
What's the difference between a debug and release version?
#5
10/09/2008 (2:07 pm)
The debug version has additional information to assist in debugging runtime issues.
#6
10/09/2008 (2:10 pm)
Debug will be larger and run slower,
but as david points out, it will have extra stuff in it to assist debugging.
debug builds are not optimized the way release builds are,
which makes debugging easier since optimization can rearrange your code.
note that you can include symbols in a release build,
so your code is still optimized, but you can still get some pretty decent run-time debugging information.
also, debug builds sometimes initialize memory where a release build doesn't,
which means that you can get crashes in release builds due to say uninitialized pointers or somesuch which don't occur in debug builds.