PlutoLang / Pluto

A superset of Lua 5.4 with a focus on general-purpose programming.
https://pluto-lang.org
MIT License
388 stars 26 forks source link

Makefile with MinGW doesn't work (missing syslibs, etc.) #845

Closed Sculas closed 6 months ago

Sculas commented 6 months ago

Reproduction steps

  1. scoop install mingw-winlibs (or your preferred method of installing MinGW)
  2. git clone https://github.com/PlutoLang/Pluto.git
  3. mingw32-make -j mingw

Expected behavior

A working pluto.exe, plutoc.exe, and libpluto.dll.

Actual behavior

A whole lot of warnings in Soup about #pragma comment being ignored, but that's to be expected since we're not using an MSVC compiler. However, now we have an issue that Ws2_32.lib, User32.lib, and Shell32.lib aren't being linked. By running commands manually I eventually got a bit further. Now it was telling me that WinMain doesn't exist, which is because MinGW requires the -municode flag to support wMain (and main), which seems to be missing from the Makefile.

Even after this, there were more errors and I eventually gave up. I've switched to using the PHP scripts, which work as expected. Still, though, I wanted to report the issue because the Makefile with MinGW doesn't work (at least, not for me).

Sainan commented 6 months ago

The makefile is for systems that are supported by the GNU C Compiler (GCC), which is all POSIX systems. Windows is decidedly not a POSIX-compliant system. There are ways to build Pluto on Windows. This is not one of them.

Sculas commented 6 months ago

Fair enough! I do think it's a good idea though to remove the MinGW target if it's unsupported, otherwise others may have the same problem. But that's up to you to decide :)