Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install lfs #99

Open
helloworldguy4 opened this issue Oct 9, 2017 · 10 comments
Open

Cannot install lfs #99

helloworldguy4 opened this issue Oct 9, 2017 · 10 comments

Comments

@helloworldguy4
Copy link

helloworldguy4 commented Oct 9, 2017

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
Copy link
Contributor

moteus commented Oct 9, 2017

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

@helloworldguy4
Copy link
Author

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

@helloworldguy4
Copy link
Author

helloworldguy4 commented Oct 9, 2017

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
Copy link
Contributor

moteus commented Oct 10, 2017

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

@KayleMaster
Copy link

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
Copy link

mrudat commented Apr 9, 2019

The easiest fix is that this is a documentation bug.

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

  • install the VC compilers
  • install the Windows 10 SDK
  • you need to use the Visual Studio Command Prompt to run luarocks install luafilesystem.

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
Copy link
Member

Tieske commented Apr 16, 2019

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

@venkateshveeroju
Copy link

Hi Team, I am still with the same issue

@Tieske
Copy link
Member

Tieske commented Sep 24, 2019

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

@JiriAtanasovsky
Copy link

JiriAtanasovsky commented Dec 19, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

7 participants