How to compile and install Lua 5.3.3 and C modules from sources on Windows
github.com
github.com
(on LUA_PATH/LUA_CPATH/PATH)
If it's a .lua file, it goes in LUA_PATH. Lua libraries with collections of files usually have a main file and a folder, so libXXX might have a main file XXX.lua and a folder XXX with auxiliary files. In this case, the main file and folder go into the same directory on the LUA_PATH.
.dll (linux: .so) files that are lua module entry points, i.e. they are loaded by the lua executable itself when you do a "require", go in LUA_CPATH.
You can see why by typing require"XXX" into the lua console - it'll say that XXX was not found and print out a list of LUA_(C)PATH entries that it searched for - note that .dll and .lua ones are looked for in different directories. So require"lib" will find a lib.lua on the LUA_PATH or a lib.dll (lib.so) on the LUA_CPATH.
If it's a dll that's not loaded through a require, but from one dll to another - like the lua ssl library loads the openSSL ones (libssl32.dll) - then it goes wherever the operating system looks for libraries, since it's the OS and not lua that'll be doing the looking. On windows the PATH is a good place to start, on linux I usually set LD_LIBRARY_PATH to pick up ones in non-standard locations.
In this manual the task is to create standalone distro so everything what normally goes to OS PATH goes in Lua's \bin directory in this case. This means if you copy this c:\work\lua folder on the freshly installed Windows it will run out of the box. And that's cool.
To just get Lua itself up and running, given a C compiler, the only step that's necessary is 3.
"install a compiler, click next, click next"
"install Git, click next, click next, don't actually use it for anything yet, you'll need it later for getting add-ons from Github the same as Linux people would"
"download code, make dir for code, cd into dir, unpack code"
Eventually, you actually have the code and you just "make"
There is a sane development available under Windows: It is called PowerShell + Visual Studio Tools. But it's not UNIX.
Having to troubleshoot compiler installation is something that just shouldn't be necessary.
[1] ex.: http://stackoverflow.com/questions/33855177/multiple-errors-...
Step two: Install "Bash for Windows aka Ubuntu root"
Step three: compile as normal
whereas with the solution here presented (and with the binaries provided on the GitHub):
"At the end you will have standalone Lua distribution for Windows which:
- runs on Windows 7, 8, 8.1, 10 ... 32/64 bit (if you can run it on XP let me know :)
- doesn't require from its user to install any additional libraries, runtimes, frameworks into his operating system to run correctly
- you can distribute to your friends, collegues or clients with your scripts as a zip archive
- you can take with you on USB key"
It's supercool, something that has been missing.
I've tested it, if the whole zip is unpacked to d:\t
Then in any directory on Windows where the test.lua is I can just invoke
d:\t\lua_ok\bin\lua.exe test.lua
and everything works, even without any environment variables!Great work. And to use this occasion, is73, thanks a lot! Consider making a paypal donation page for you. Wow, now I see, you also make a portable PHP 7.