As an environment for building Windows binaries MSYS2 improves upon MinGW/MSYS in several important ways. When you switch, however, you will notice that its builds of Lua, unlike those produced with plain old
mingw-base, depend upon external DLLs by default.
When you build Lua 5.1.5 with MSYS2's 32-bit version of MinGW-w64 using the command
make mingw you end up with a
lua51.dll that requires
$ wget https://www.lua.org/ftp/lua-5.1.5.tar.gz $ tar xvf lua-5.1.5.tar.gz $ cd lua-5.1.5/src/ $ make mingw $ ldd lua51.dll ntdll.dll => /c/WINDOWS/system32/ntdll.dll (0x7c900000) kernel32.dll => /c/WINDOWS/system32/kernel32.dll (0x7c800000) msvcrt.dll => /c/WINDOWS/system32/msvcrt.dll (0x77c10000) libgcc_s_dw2-1.dll => /mingw32/bin/libgcc_s_dw2-1.dll (0x6eb40000) libwinpthread-1.dll => /mingw32/bin/libwinpthread-1.dll (0x64b40000)
If you want fewer DLLs to manage you have several options. For a quick fix you could build a Lua interpreter statically with
make all — but then you would not be able to use binary modules, which expect a
lua51.dll. A solution that keeps
lua51.dll is explained below.