When I compile a file called test.zig
export fn main() void {}
With 'zig build-obj test.zig', as well as compile compiler_rt/stack_probe.zig (for __chkstk_ms) in the same manner, and then try to link that with msvc's link.exe, against kernel32.lib, libcmt.lib, user32.lib, ntdll.lib and vcruntimed.lib, I get 'unresolved external symbol __main'. When I look at the disassembly of the object file exported by zig, there is indeed a call to '__main' inserted at the top of the main function.
So, my main question: why is this? What can I do about it?
And bonus questions :): I'd rather not compile every compiler_rt file manually when needed for e.g. memcpy, memset, __chkstk_ms. Can the zig compiler not use these functions automatically?
EDIT: and, why is there a test.obj and a test.obj.obj created?