• Announcement: Lua.org now officially recommends this forum as a meeting place for the Lua community

Windows Best way to install and develop in lua on windows 10 (1 Viewer)

deb75

Newcomer
Joined
May 23, 2021
Messages
2
Reaction score
0
Hello,

I am struggling to install a working environment in lua on windows.

Currently, I chose to install msys2/mingw64 system because it includes lua 5.4 and
because of the development tool chain which should make easy to install lua packages
through luarocks.

Alas, luarocks (provided by mingw64) does not seem to be working, it fails with strange errors.

I installed luarocks from the original site. I do not have previous errors, but it is difficult to configure, here is mine :

Code:
rocks_trees = {
    home..[[/luarocks]],
    { name = [[user]],
         root    = home..[[/luarocks]],
    },
    { name = [[system]],
         root    = [[d:\xxx\Documents\utils\luarocks-3.7.0\systree]],
    },
}
variables = {
    MSVCRT = 'm',   -- make MinGW use MSVCRT.DLL as runtime
    LUALIB = 'liblua.dll.a',
    LUA_DIR = [[D:\xxx\Documents\utils\msys64\mingw64]],
    LUA_BINDIR = [[D:\xxx\Documents\utils\msys64\mingw64\bin]],
    LUA_INCDIR = [[D:\xxx\Documents\utils\msys64\mingw64\include]],
    LUA_LIBDIR = [[D:\xxx\Documents\utils\msys64\mingw64\bin]],
    CC = [[D:\xxx\Documents\utils\msys64\mingw64\bin\gcc.exe]],
    MAKE = [[D:\xxx\Documents\utils\msys64\mingw64\bin\djvumake.exe]],
    RC = [[D:\xxx\Documents\utils\msys64\mingw64\bin\windres.exe]],
    LD = [[D:\xxx\Documents\utils\msys64\mingw64\bin\gcc.exe]],
    AR = [[D:\xxx\Documents\utils\msys64\mingw64\bin\ar.exe]],
    RANLIB = [[D:\xxx\Documents\utils\msys64\mingw64\bin\ranlib.exe]],
}

I am not sure of the LUALIB and LUA_LIBDIR variables : liblua.dll.a is
in D:\xxx\Documents\utils\msys64\mingw64\lib, not bin, but in bin there is
lua54.dll

If I set LUA_LIBDIR to D:\xxx\Documents\utils\msys64\mingw64\lib, luarocks outputs
an error saying that it does not find the path (!?)

Are my settings correct ?

Thanks in advance for your help

Regards
 

Arghtastic

Newcomer
Joined
Apr 26, 2021
Messages
3
Reaction score
0
So, I am not very good, but I found that Gitbash let me run luajit pretty well. As I had to make something to process a horrendously large flat file, the table structures in lua + luajit compiler made it a breeze to do a ton of fast in-memory processing.

I hope this helps or you have made process since your post.
 

dinsdale247

Moderator
Staff member
Community Patron
Creator of WinLua
Joined
Nov 17, 2020
Messages
93
Reaction score
32
Location
Victoria BC
Website
winlua.net
Hi,

Try downloading my Winlua installer? WinLua - Lua Plus Tools for Windows. LuaRocks is installed and set up to work with Lua 5.3. The installer takes care of the paths and whatnot.

It also comes with a C/C++ compiler that works mostly out of the box. The installer includes Lua 5.4, but you would have to copy and modify the luarocks 5.3 config file to get 5.4 working together with LuaRocks (5.4 is lightly tested).

I'm behind on my next release. llvm had a regression in the 12.0 release so I am waiting on the next release to re-package.

All feedback welcome.
 

hemmerling

Newcomer
Joined
Jul 7, 2021
Messages
9
Reaction score
4
Hello, nice to learn about MSYS2.

I installed Lua 5.3 ( as I need it for the CORE game development framework, which will probably never move to 5.4, as Roblox never left 5.1 )


“5.3.6 / Tools Executables”.
You need all 3:
  • “lua-5.3.6_Sources.zip” - Source Code and Makefiles.
  • “lua-5.3.6_Win64_bin.zip” - Windows x64 Executables.
  • “lua-5.3.6_Win64_dllw6_lib.zip” - Windows x64 DLL and Includes (MingW 6 Built).

I postet links to my homepage with a bunch of HTML pages about Lua, in this forum
, as these infos describe best my way and state to develop Lua scripts.

If you are familiar with Linux ( or would like to become... ), take a second computer - or use a virtual machine - and install Lua both for Windows and Linux, using VisualStudio Code as platform-independant IDE on both operating systems, with all relevant plugins for intellisense + debugging.

By that you can always cross-check if you have the "same" problem on Windows as on Linux... and your code gets less platform-specific, i.e. the code gets more portable.

LuaRocks: I never setup such a configuration file.... you need just proper environment variable settings for Lua 5.3 on Win10, see en:lua02.html [Hemmerling (R) - Quality Intensification for IT + Automation]

So, I am not very good, but I found that Gitbash let me run luajit pretty well
As far as I learned, there is no current LuaJIT distribution, i.e. LuaJIT 5.3 or even 5.4 available:

1. The LuaJIT Project - Last release 2017-05-01 :-(.
2. Moonjit, an effort to continue LuaJIT, did not make much steps!? GitHub "Moonjit. Just In Time compiler for the Lua Programming Language".

If so, anyhow, please tell me where.
 
Last edited:
Top