5 ms·
I tried your program with MSVC using the following command: cl small2.c /MD /link /entry:_start /subsystem:CONSOLE kernel32.lib It's 5kb.
by ChrisSD 6y ago
I tried your program with MSVC using the following command:
cl small2.c /MD /link /entry:_start /subsystem:CONSOLE kernel32.lib
It's 5kb.
- slezyr 6y agoIf I remember correctly you need a /nodefaultlib flag to disable stdlibs https://docs.microsoft.com/en-us/cpp/build/reference/nodefaultlib-ignore-libraries?redirectedfrom=MSDN&view=msvc-160 https://docs.microsoft.com/en-us/cpp/build/reference/nodefau...
- ChrisSD 6y agoOk, I've just tried that but I also needed to add `/force` otherwise it complained about missing symbols. So the full compile line is: cl small2.c /link /force /nodefaultlib /entry:_start /subsystem:CONSOLE kernel32.lib This gets it down to 3kb.