• Announcement: Lua.org now officially recommends this forum as a meeting place for the Lua community
  • The forum is currently open to new registrations. The registration will close for a short period of time when reaching 500 active members, to upgrade the server resources.

Windows setting up luarocks on windows 10 (1 Viewer)

rco

Newcomer
Joined
Jun 12, 2020
Messages
1
Reaction score
0
Age
34
Location
Germany
Hello,

im relatively new to Lua but not programming in general (15+ years).

I am having a hard time to set up luarocks on windows so i can install packages with luarocks.

What i have done so far is downloading lua53 and the latest luarocks (3.3.1).
I've created a folder on the c drive with the following structure:

C:
----lua\
--------bin\
------------clibs\
------------lua53.dll
------------lua53.exe
--------lualibs\
--------luarocks\
------------luarocks.exe
------------luarocks-admin.exe

I've added "c:\lua\bin" and "c:\lua\luarocks" to PATH variable
I've created a "config-5.3.lua" at location "C:\Program Files\luarocks" and "C:\Users\Me\AppData\Roaming\luarocks\"

The content of both "config-5.3.lua" is:
Lua:
variables = {
   LUA_LIBDIR = "C:\\lua\\lualibs"
}

Now when i want to install a package with luarocks i get the following Error:

1591958890852.png


What am i suppose to do with the LUA_LIBDIR?
I thought it is already set in "config-5.3.lua"?

Can someone help me?
 

dinsdale247

Moderator
Staff member
Community Patron
Creator of WinLua
Joined
Nov 17, 2020
Messages
68
Reaction score
27
Location
Victoria BC
Website
winlua.net
Hi! LUA_LIBDIR is the location of the shared object used for linking to the modules. In your case it's your bin dir. If you are not using gcc/mingw (e.g. If you are using Microsoft VC++) you will need to include the lua53.lib file in that directory for linking.

Here is an example of my config.5.3.lua file (In all it's raw glory):
Lua:
rocks_trees = {
    {
            name = "user",
            root = "home..[[/luarocks]]" ---< SO WRONG AND BROKEN! Lolz.
        },
    {
            name = "system",
            root = "C:/Program Files (x86)/WinLua/Lua/5.3/"
        }
}
variables = {
    LUA_LIBDIR = "C:/Program Files (x86)/WinLua/Lua/5.3/bin/",
    LUA_INCDIR = "C:/Program Files (x86)/WinLua/Lua/5.3/include/",
    LUALIB = "lua53.lib",
    CC = "wlc32.exe",
    CPP = "clang++.exe",
    LD = "wlc32.exe"
}
external_deps_dirs = {
    "C:/Program Files (x86)/WinLua/WLC/i686-w64-mingw32/"
}
external_deps_patterns = {
    bin = {
            "?.exe",
            "?.bat"
        },
--NOTE: This won't be needed for you.
    lib = {
            "lib?.a",
            "lib?.dll.a",
            "?.dll.a",
            "?.lib",
            "lib?.lib"
        },
    include = {
            "?.h"
        }
}
verbose = false-- set to 'true' to enable verbose output

You may have noted the paths to WinLua. Check out WinLua - Lua Plus Tools for Windows. It's a complete Lua and C/C++ toolchain that sets up all the paths for you. WinLua has Lua, LuaRocks, XMake (lua based) build system and LLVM compiler.
 
Last edited:
Top