TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How to compile and install Lua 5.3.3 and C modules from sources on Windows

26 pointsby alvilalmost 9 years ago

6 comments

red_admiralalmost 9 years ago
&gt; Some principles as far as I understand them<p>(on LUA_PATH&#x2F;LUA_CPATH&#x2F;PATH)<p>If it&#x27;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.<p>.dll (linux: .so) files that are lua module entry points, i.e. they are loaded by the lua executable itself when you do a &quot;require&quot;, go in LUA_CPATH.<p>You can see why by typing require&quot;XXX&quot; into the lua console - it&#x27;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&quot;lib&quot; will find a lib.lua on the LUA_PATH or a lib.dll (lib.so) on the LUA_CPATH.<p>If it&#x27;s a dll that&#x27;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&#x27;s the OS and not lua that&#x27;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.
评论 #12175522 未加载
Tomtealmost 9 years ago
Building it with MS Visual Studio is pretty painless, so I&#x27;m not sure why they are going the MinGW route. Just because of the libraries?
评论 #12175150 未加载
sdegutisalmost 9 years ago
Soon this will be outdated, since Windows users will be able to use the same instructions as on Linux, using Windows Subsystem for Linux.
评论 #12174829 未加载
评论 #12174783 未加载
corysamaalmost 9 years ago
For anyone not familiar with Lua, this guide includes instructions for adding on several bonus packages beyond the base Lua interpreter.<p>To just get Lua itself up and running, given a C compiler, the only step that&#x27;s necessary is 3.
creshalalmost 9 years ago
It&#x27;s sad how &quot;compile something <i>on Windows</i>&quot; is something deserving elaborate how-tos. How hard can it be to provide a sane development environment?
评论 #12175673 未加载
评论 #12176119 未加载
fritzyalmost 9 years ago
Step one: Enable Linux Subsystem for Windows<p>Step two: Install &quot;Bash for Windows aka Ubuntu root&quot;<p>Step three: compile as normal
评论 #12175922 未加载