How do I create Lua for Windows using MinGW and MSYS?

I have a book called Beginning Lua Programming, which is supposed to go back to basics, but it's kind of like leaving me in difficulty. Here is an attempt to condense 3 pages:

Quote:

The following environment variables are recommended for Windows: UTIL_DIR=c:\program files\utility LUA_DIR=c:\program files\lua\5.1 LUA_CPATH=?.dll;%LUA_DIR%\?.dll LUA_PATH=?.lua;%LUA_DIR%\?.lua The UTIL_DIR variable identifies the utility directory you created in the preceding section. 

After that, there is a segment about setting up a "window search path" for lua. Basically, he tells me to see the result of "doskey /?" and the "path" and understand it yourself. I have no idea what they are doing, how to use them, and what is the difference between them.

I'm crazy. A detailed explanation or link to a detailed blog / article or youtube video is much appreciated!

+4
source share
1 answer

There are several ways to get Lua to work on your computer. If you just want the Lua functional environment to rush with minimal clutter, consider downloading one of the Lua precompiled binaries. Common are Lua for Windows and LuaBinaries .

Building Lua with Mingw is not too complicated:

  • First get your desired version of Lua here .
  • Extract the tar file containing the Lua source. In this example, I will assume that you are checked out in c:\lua
  • If you already have Msys installed, you can run the makefile from this environment. From the Msys shell, you can build lua with the following commands:

     cd /c/lua make PLAT=mingw make install 
  • You should find lua.exe and luac.exe somewhere there after the build is complete. Lua should be ready for use at this point.

The regular cmd.exe shell may also work with some changes to the commands:

  cd lua mingw32-make PLAT=mingw 

make install assumes a * nix environment and therefore does not work in the regular cmd shell. In this case, you can manually copy the compiled files from .\lua\src to where you want, or you can just run it directly from there if you want.

+9
source

Source: https://habr.com/ru/post/1481685/


All Articles