lunarmodules / luafilesystem

LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution.
https://lunarmodules.github.io/luafilesystem/
MIT License
896 stars 290 forks source link

Cannot install lfs #99

Open helloworldguy4 opened 6 years ago

helloworldguy4 commented 6 years ago

If im trying to install luafilesystem on Windows 10 with luarocks and lua 5.1 then its not working. Heres the full log: (no matter if im entering it with --local or not, its the same)

C:\Users\LuckyChicken>luarocks install luafilesystem --local Installing https://luarocks.org/luafilesystem-1.7.0-2.src.rock cl /nologo /MD /O2 -c -Fosrc/lfs.obj -IC:/Program Files (x86)/LuaRocks/include src/lfs.c Der Befehl "cl" ist entweder falsch geschrieben oder konnte nicht gefunden werden.

Error: Build error: Failed compiling object src/lfs.obj

(The text "Der Befehl "cl" ist entweder falsch geschrieben oder konnte nicht gefunden werden." is german and means in english: Could not found the command "cl")

I think theres something wrong with the installation. Im on windows and I dont have the command "cl"

What can I do?

moteus commented 6 years ago

Just tested. All works with MSVC 2010 on Windows 7. Did you run this command from Visual Studio Command Prompt?

helloworldguy4 commented 6 years ago

No I run this command from the normal cmd because I have installed luarocks there

helloworldguy4 commented 6 years ago

But I also have linux subsystem on my windows. So I can use bash. And if im installing it there it works. But unfornately I can still not use lfs somehow then if im requiring it.

moteus commented 6 years ago

Again. Try run luarocks install luafilesystem from correct Visual Studio Command Prompt

KayleMaster commented 6 years ago

Go to your visual studio installation and there should be a vcvarsall bat file. CMD there and do vcvarsall x86 (assuming you're 32 bit). type cl in console and check if it works.

mrudat commented 5 years ago

The easiest fix is that this is a documentation bug.

The installation instructions for windows need to state that you need to:

I'm guessing that once compilation is complete you can just use luafilesystem directly? If not the luarock is broken on windows, as it is no longer self contained.

The right fix would be to use autotools to find the most appropriate C compiler and libraries.

eg. for windows (with the aid of chocolatey), you can:

PS > choco install mingw
... lots of stuff here ...
PS > choco install make
... more stuff here ...
PS > cat hello.c
#include <stdio.h>

int main() {
        printf("Hello, World!\n\r");
        return 0;
}
PS > make hello CC=gcc
gcc     hello.c    -o hello
PS > ./hello
Hello, World!

presuming you're presenting only the standard C filesystem APIs to lua, if you build using mingw, you can pretend windows doesn't exist, and throw away all of the windows-specific build stuff.

Tieske commented 5 years ago

@hishamhm can we close this? enough solutions presented...

venkateshveeroju commented 4 years ago

Hi Team, I am still with the same issue

Tieske commented 4 years ago

@venkateshveeroju what's the exact error you're getting?

JiriAtanasovsky commented 3 years ago

Hello, Im getting the very same error with LUA 5.3 and MinGW compiler.

PS C:\Users\Pc> luarocks install luafilesystem
Installing https://luarocks.org/luafilesystem-1.8.0-1.src.rock

luafilesystem 1.8.0-1 depends on lua >= 5.1 (5.3-1 provided by VM)
mingw32-gcc -O2 -c -o src/lfs.o -IC:\Lua\src src/lfs.c

Error: Build error: Failed compiling object src/lfs.o