>> VC++ can dynamically link with libraries, you just have to
>> tweak the right option
>> I don't have it to hand at the moment to find out though.

This is part of Tybalt's "trick". Under project/settings/C-C++/code generation/use run-time library there is an entry for "Multithreaded dll". Applying this reduced the size of the .exe to 16384 bytes.

But he also does: under project/settings/link/Project Options add an entry "/align:16384" (this number has nothing to do with the 16384 I mentioned above; purely coincidental). After adding that switch and re-compiling & building, the .exe is now only 6656 bytes.


Do you know what that /align switch is doing?


---------------------------------------------------------------------------

I did some more googling & found that there is a command-line switch for the Borland compiler, -tWCR that enables dynamic linking. Using that brings the Borland-compiled .exe down to 9,216 bytes. But now it only runs on a computer that has Borland's runtime library installed.

On the other hand, the tiny VisualC++ .exe compiled with Tybald's approach seems to run on any Windows PC. Is it using a runtime library that is actually a part of Windows itself?

-----------------------------------------------------------------------------

>> VC++ can edit files in binary mode. Load the "before and
>> after" copies of the executable.
>> You'll still see a lot of symbolic information in the original

I looked at them, but I'm not sure what I'm supposed to see. I see that there's a lot more code in the original, but we already knew that. And I have no idea what the code means.