Stream: cranelift

Topic: missing entry point on windows for compilation


view this post on Zulip Cregg (May 02 2024 at 01:19):

When compiling an object produced by cranelift on linux everything works exactly as I expect but when I try to compile it on windows I get an error about a missing entry point. With gcc this is "undefined reference to `WinMain'" and with cl its "LINK : fatal error LNK1561: entry point must be defined". Is there something I need to do to identify the main function as such when generating the ir?

view this post on Zulip bjorn3 (May 02 2024 at 13:31):

The main function should work if you are linking against libc. WinMain is the entrypoint on Windows when not using libc.

view this post on Zulip Cregg (May 02 2024 at 20:55):

Thanks for the help! I had foolishly failed to export the main function.


Last updated: Dec 23 2024 at 13:07 UTC