pigpigyyy / Yuescript

A Moonscript dialect compiles to Lua.
http://yuescript.org
MIT License
424 stars 35 forks source link

compilation for windows (msys64) #157

Closed heavyk closed 6 months ago

heavyk commented 7 months ago

just to let you know, in order to get yue to compile on windows msys64, I had to do the following...

add to linenoise.hpp: #include <strings.h>

change in makefile: -std=c++17 to -std=gnu++17 (someone also suggested this will work for cmake: CMAKE_CXX_EXTENSIONS ON)

relevant errors:

Compiling: src/yue.cpp -> build/release/yue.o
In file included from src/yue.cpp:31:
./src/3rdParty/linenoise.hpp: In function ‘bool linenoise::isUnsupportedTerm()’:
./src/3rdParty/linenoise.hpp:1590:14: error: ‘strcasecmp’ was not declared in this scope; did you mean ‘strncmp’?
 1590 |         if (!strcasecmp(term,unsupported_term[j])) return true;
      |              ^~~~~~~~~~
      |              strncmp
Compiling: src/3rdParty/efsw/FileInfo.cpp -> build/release/3rdParty/efsw/FileInfo.o
src/3rdParty/efsw/FileInfo.cpp: In member function ‘std::string efsw::FileInfo::linksTo()’:
src/3rdParty/efsw/FileInfo.cpp:188:28: error: ‘realpath’ was not declared in this scope
  188 |                 char* ch = realpath( Filepath.c_str(), NULL );
      |                            ^~~~~~~~
pigpigyyy commented 6 months ago

Tried to fix this issue by replacing the two functions with the standard C++ alternatives by a1d719e3bbfe8cd39c05d2a8f49143b9e814f876.

heavyk commented 6 months ago

I finally got it working with msvc 2022, cause msys64 was nothing but problems (I also installed scoop as a replacement).