Closed jon-lipstate closed 5 months ago
What happens if you do odin run . -no-crt
?
raylib wants to use the crt so it panics:
odin run . -no-crt
c:/Odin/core/c/libc/types.odin(5:1) Error: Compile time assertion: !ODIN_NO_CRT (`"core:c/libc" cannot be imported when '-no-crt' is used`)
#assert(!ODIN_NO_CRT, `"core:c/libc" cannot be imported when '-n ...
The root issue is that no-crt is added to the link step but import raylib (which is not used) is not pruned.
Ah yes, I think I understand the issue better now. As much as I'd like to say that it's probably not a problem in this case and can be dismissed as a side effect of the pruning system, I think it might cause issues in the future, where something gets imported transitively and removes that dependency on libc without making any substitutions.
Doesn't seem to be happening on macos/linux
I notice the same on Ubuntu today as well. So windows-only as an issue
I found an issue when putting in some debug code (
if true do return
). if this is placed before the first call to raylib, then the linker fails to link to the CRT. it can be mitigated by calling basically any raylib procedure above the if true do return statement. The linker appends/NODEFAULTLIB:libcmt
.