nim c helloworld.nim
It results in a longer error message:
Error: execution of an external compiler program 'gcc.exe -c -w -mno-ms-bitfields -IC:\nim-1.0.4\lib -IE:\Nim\Test -o C:\Users\cs\nimcache\hello_d\@mhello.nim.c.o C:\Users\cs\nimcache\hello_d\@mhello.nim.c' failed with exit code: 1 In file included from C:\Users\cs\nimcache\hello_d\@mhello.nim.c:9:0: C:\nim-1.0.4\lib/nimbase.h:457:13: error: size of array 'Nim_and_C_compiler_disagree_on_target_architecture' is negative typedef int Nim_and_C_compiler_disagree_on_target_architecture[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1];
Not really understanding but reading target and "architecture* I look into the compiler manual and find --cpu:SYMBOL . But where are the SYMBOLS listed and explained? I found an example --cpu:i386 and simply tried it:
nim c --cpu:i386 helloworld.nim
Bingo, exe is generated without complains. But I feel uncomfortable because I don't really understand the things happening here.
What did I do wrong? How can I avoid frustration already on the very basic step? Where do I find systematic documentation about those issues?
Success: I deleted the manual extracted mingw-folder and restarted finish.exe, which subsequently downloaded the appropriate mingw-package.
Thanks to you both for the help.
Now what if I wanted to create 32-bit-executable? In my understanding I have to download mingw32 additionally and invoke the nim-compiler using --cpu:i386 , but that alone won't do it, I assume, because the path is set to the 64bit-mingw.
Now what if I wanted to create 32-bit-executable?
In your current cmd session, invoke set PATH=d:\your-mingw32-i686-path-bin;%PATH% , this way the mingw32 32bit will be prioritized.