Your problem might related this issue:
[https://github.com/nim-lang/Nim/issues/8648](https://github.com/nim-lang/Nim/issues/8648)
When backend C compiler output large message to stdout, Nim compiler hangs. It
seems Nim compiler hangs with smaller message on Windows than on Linux.
This code passes const string in Nim code to C code as define.
test.nim:
const
FOO = "abcd"
proc xyz() {.importc.}
xyz()
{.passC: "-DFOO=\\\"" & FOO & "\\\"".}
{.compile: "test.c".}
Run
test.c:
#include <stdio.h>
void xyz() {
printf("%s\n", FOO);
}
Run