Yo guys, new guy here.
I'm a game dev who just finished his game in nim (well, wrote 90% of the engine in C first and then I rewrote it in nim a half a year ago). Since I primarily use Linux for devving, I only tested an early version of the game on windows, and it compiled just fine.
The problem is that, now that the game is finished, I'm trying to compile it on windows, but I'm getting the following error:
Error: invocation of external linker program failed. The filename or extension is too long.
And, well, the compiler has a point, since the project consists of more than 400 nim files. The problem is that:
Please tell me everything I can do to have it compile.
Hope something like this works for you.
Araq, thanks for the quick reply.
I tried your workaraound, but it didn't work. Specifically, nim doesn't seem to recognise the jsonscript command. But from having a look into the json file, it seems like the faulty line is the last one, which goes something like this:
"linkcmd": "gcc.exe -o C:\\Users\\etc. etc."
where etc. etc. is the loooong list of files in the project. I tried converting all the absolute filepaths to relative ones and then recompiling, but it seems that the json file gets overwritten. The --compileOnly doesn't throw the error, but it doesn't seem to actually generate an executable.
I'm using GCC on linux too, so that can't be the problem, unless there is some Windows specific quirk.
Isn't there a way to cross-compile directly from Linux to W64? That would solve all of my problems.
Yeah, sorry if I've been more of a lurker, I'm spending all of my time on the game.
I had in mind to introduce myself to the community after I ship the game, maybe write a post-mortem and release the source code. I should be able to do so in March.
As of now I can say that Nim has proven to be a life-saver for me.
I did find a few problems beside the one in this thread. For example, in 0.17.2 assignement with case expression doesn't work, but I think it's already fixed in devel. And the support for neovim is pretty shitty. But overall the language is amazing. I managed to rewrite the engine from C to Nim in just a month, and it ended up being about 5-10% faster too.
I'll write a more detailed breakdown when I'll release the game.
I'm using GCC on linux too, so that can't be the problem, unless there is some Windows specific quirk.
Yes, command line on windows is limited to 8191 characters. On Linux it is variable but generally much larger, you can check yours using:
$ getconf ARG_MAX
it is 2097152 on my machine.