lua Failed finding Lua header files. You may need to install them or configure LUA_INCDIR

1.1k Views Asked by At

i am a newby in lua and installed the version 5.4.2 und luarocks in the version 3.9.2 in windows. I added the two tools into the $PATH by system variables.

But i tried to install a library with luarocks and got this error:

luarocks install lua-cjson
Warning: Lua 5.4 interpreter not found at C:\Program Files\luarock

Modules may not install with the correct configurations. You may want to configure the path prefix to your build of Lua 5.4 using

   luarocks config --local lua_dir <your-lua-prefix>

Installing https://luarocks.org/lua-cjson-2.1.0.10-1.src.rock

Error: Failed finding Lua header files. You may need to install them or configure LUA_INCDIR.

i tried this with another error:

luarocks config lua_dir "C:\Program Files\lua-5.4.2"
Wrote
        lua_interpreter = "lua.exe"
        variables.LUA_BINDIR = "C:\\Program Files\\lua-5.4.2"
        variables.LUA_DIR = "C:\\Program Files\\lua-5.4.2"
        variables.LUA_LIBDIR = "C:\\Program Files\\lua-5.4.2"
to
        C:/Users/me/AppData/Roaming/luarocks/config-5.4.lua


C:\Users\me>luarocks install lua-cjson
Installing https://luarocks.org/lua-cjson-2.1.0.10-1.src.rock

Error: Failed finding Lua header files. You may need to install them or configure LUA_INCDIR.

C:\Users\me>luarocks config --local lua_dir C:\Program Files\lua-5.4.2

C:\Users\me>luarocks config LUA_INCDIR "C:\Program Files\lua-5.4.2"
Wrote
        LUA_INCDIR = "C:\\Program Files\\lua-5.4.2"
to
        C:/Users/me/AppData/Roaming/luarocks/config-5.4.lua

C:\Users\me>luarocks install lua-cjson
Installing https://luarocks.org/lua-cjson-2.1.0.10-1.src.rock

Error: Failed finding Lua header files. You may need to install them or configure LUA_INCDIR.

luarocks return:

C:\Users\me>luarocks
...
Variables:
   Variables from the "variables" table of the configuration file can be
   overridden with VAR=VALUE assignments.

Configuration:
   Lua:
      Version    : 5.4
      Interpreter: C:\Program Files\lua-5.4.2/lua.exe (ok)
      LUA_DIR    : C:\Program Files\lua-5.4.2 (ok)
      LUA_BINDIR : C:\Program Files\lua-5.4.2 (ok)
      LUA_INCDIR : C:\Program Files\lua-5.4.2 (not found)
                   ****************************************
                   Use the command

                      luarocks config variables.LUA_INCDIR <dir>

                   to fix the location
                   ****************************************
      LUA_LIBDIR : C:\Program Files\lua-5.4.2 (ok)

   Configuration files:
      System  : C:/Program Files/luarocks/config-5.4.lua (ok)
      User    : C:/Users/xemleue/AppData/Roaming/luarocks/config-5.4.lua (ok)

   Rocks trees in use:
      C:\Users\me\AppData\Roaming/luarocks ("user")

i tried luarocks config variables.LUA_INCDIR "C:\Program Files\lua-5.4.2" but same problem.

0

There are 0 best solutions below