0

I try to run luarocks install luafilesystem command in Visual Studio Command Prompt. But it says "Error: Failed finding Lua library. You may need to configure LUA_LIBDIR".

Why am i getting that error?(This time i got it Piglet :))

  • Does this answer your question? [Luarocks on windows not recognizing my lua\_libdir](https://stackoverflow.com/questions/52026115/luarocks-on-windows-not-recognizing-my-lua-libdir) – Joseph Sible-Reinstate Monica Apr 21 '20 at 17:51
  • searching the web for error messages usually yields several solutions. it is very unlikely that you're the first to run into any problem. – Piglet Apr 21 '20 at 18:06
  • Well i searched but it looks like i don't know how to search or don't know how to use internet at all. –  Apr 21 '20 at 18:16
  • @JosephSible-ReinstateMonica but the thing is inside my lua/lib dir there is a luarocks folder. Shouldn't lib dir contain lua52.dll? –  Apr 21 '20 at 18:59

1 Answers1

0

LuaRocks cannot find a Lua library and needs one to install the luafilesystem module.

You could indicate your Lua library to LuaRocks using the --lua-dir command argument:

luarocks --lua-dir C:/bin/lua-5.3.5 install luafilesystem

Note that there is several way to indicate the Lua's libraries dir to LuaRocks, please check the LuaRocks documentation.

You could find pre-compiled Lua libraries and executables here.

The luafilesystem module is based on C source code and needs to be transformed into a dynamic library prior the installation.

Generating a dynamic library, such as lfs.dll or lfs.so, requires to compile the C source code then to link the result, such as lfs.o, against the Lua library.

Samuel
  • 56
  • 2
  • So now it says;" 'mingw32-gcc' " is not recognized as an internal or external command, operable program or batch file. Error: Build error: Failed compiling object src/lfs.o. How do i overcome this problem and why this happens? –  Apr 21 '20 at 20:27
  • In addition to the Lua library, you need to setup the compilation tool chain. – Samuel Apr 22 '20 at 17:38
  • As explained in the [LuaRocks documentation](https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Windows): To compile many Lua packages, you will also need a C compiler. I do not use MSVC so I cannot help you. You could start by checking if the MSVC compiler is available where you launched LuaRocks. – Samuel Apr 22 '20 at 17:49