3 ms·
> Some principles as far as I understand them (on LUA_PATH/LUA_CPATH/PATH) If it's a .lua file, it goes in LUA_PATH. Lua libraries with collections of files u
by red_admiral 10y ago
> Some principles as far as I understand them
(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.
- alvil 10y ago> 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) 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.