I've been trying to compile a trivial program (extern C int main() {return 0;}) without linking parts of the C runtime with no success.

I compile with dmd -debuglib= -defaultlib= -v -L=/INFORMATION -betterC but optlink shows a lot of things from snn.lib being pulled in and the resultant executable is about 12kb. I also replaced object.d with an empty module.

If I pass /nodefaultlib to the linker I get warning 23: no stack and __acrtused_con is undefined so the linker fails with no start address.

Is it possible to completely remove the C runtime on windows, and if so how? Sorry for the sloppily formatted post.

Reply via email to