Closed vanous closed 7 years ago
You can try compile with -d:nimxAvoidSDL to use experimental winapi instead of sdl.
thank you, bu no luck, same error:
nim --os:windows --cpu:amd64 --gcc.exe:x86_64-w64-mingw32-gcc --gcc.linkerexe:x86_64-w64-mingw32-gcc --app:gui -r --noMain --threads:on -d:nimxAvoidSDL c main.nim
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): In function main': ./mingw-w64-crt/crt/crt0_c.c:18: undefined reference to
WinMain'
Don't use --noMain
. For windows we need WinMain
.
nim --os:windows --cpu:amd64 --gcc.exe:x86_64-w64-mingw32-gcc --gcc.linkerexe:x86_64-w64-mingw32-gcc --app:gui -r --threads:on c main.nim
thank you, this worked!
Hello,
new to nim and nimx. setting up my environment (debian amd64). Compilation of your hello world on linux for linux works OK, but when trying to cross compile for WIN target:
nim --os:windows --cpu:amd64 --gcc.exe:x86_64-w64-mingw32-gcc --gcc.linkerexe:x86_64-w64-mingw32-gcc --app:gui -r --noMain --threads:on c main.nim
it fails (probably during linking) with this message:
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): In function
main': ./mingw-w64-crt/crt/crt0_c.c:18: undefined reference to
WinMain' collect2: error: ld returned 1 exit statusFull log here: https://pastebin.com/UwfB8D4J
Or do i need to cross-compile libsdl2 first?
thank you