TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

26 点作者 alvil将近 9 年前

6 条评论

red_admiral将近 9 年前
&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 未加载
Tomte将近 9 年前
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 未加载
sdegutis将近 9 年前
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 未加载
corysama将近 9 年前
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.
creshal将近 9 年前
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 未加载
fritzy将近 9 年前
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 未加载