st3w / neo

Simulates the digital rain from "The Matrix" (CMatrix clone with 32-bit color and Unicode support)
Other
666 stars 25 forks source link

MSYS2 compilation #27

Open lxhom opened 1 year ago

lxhom commented 1 year ago

Hey there, just wanted to let you know that you can indeed run Neo on native Windows with MSYS2 by adding #define _GNU_SOURCE to src/neo.cpp. I got this error first:

neo.cpp: In function ‘void ParseArgs(int, char**, Cloud*, double*, bool*)’:
neo.cpp:515:17: error: ‘strcasecmp’ was not declared in this scope; did you mean ‘strncmp’?
  515 |             if (strcasecmp(optarg, "ascii") == 0) {
      |                 ^~~~~~~~~~
      |                 strncmp
neo.cpp:575:17: error: ‘strcasecmp’ was not declared in this scope; did you mean ‘strncmp’?
  575 |             if (strcasecmp(optarg, "green") == 0) {
      |                 ^~~~~~~~~~
      |                 strncmp
neo.cpp: In function ‘int main(int, char**)’:
neo.cpp:827:16: error: ‘strcasestr’ was not declared in this scope; did you mean ‘strstr’?
  827 |     if (loc && strcasestr(loc, "UTF") != nullptr)
      |                ^~~~~~~~~~
      |                strstr
make[1]: *** [Makefile:371: neo.o] Error 1

But after googling a bit, I came across this: https://github.com/jarun/nnn/issues/784, and I just tried putting #define _GNU_SOURCE into the source file. Maybe including something like https://github.com/jarun/nnn/commit/d38f4b13d422963b06b4fb92df771aab154539e0 could fix this properly, but I don't know exactly if/what that would break. You can add to the readme that it is possible that way :)

image

Welding-Torch commented 5 months ago

Is it possible to make neo on windows without MSYS2 and using only MinGW-w64 ?