3 ms·
If I remember correctly you need a /nodefaultlib flag to disable stdlibs https://docs.microsoft.com/en-us/cpp/build/reference/nodefaultlib-ignore-libraries?red
by slezyr 6y ago
If 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.