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
900 stars 291 forks source link

Fatal Error - /usr/include/features.h:461:12: fatal error: sys/cdefs.h: No such file or directory #145

Open nodecentral opened 3 years ago

nodecentral commented 3 years ago

I’ve tried to install lfs via luarocks but received the following error.

admin@ubuntu2004:~/Documents$ sudo luarocks install luafilesystem
Installing https://luarocks.org/luafilesystem-1.8.0-1.src.rock
gcc -O2 -fPIC -I/usr/include/lua5.3 -c src/lfs.c -o src/lfs.o
In file included from /usr/include/errno.h:25,
                 from src/lfs.c:41:
/usr/include/features.h:461:12: fatal error: sys/cdefs.h: No such file or directory
  461 | #  include <sys/cdefs.h>
      |            ^~~~~~~~~~~~~
compilation terminated.

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

Other information that might help.

admin@ubuntu2004:~/Documents$ lua -v
Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
admin@ubuntu2004:~/Documents$ luarocks
LuaRocks 2.4.2, a module deployment system for Lua
nodecentral commented 3 years ago

Ok, on Ubuntu the fix was to use the following instead..

sudo apt-get install -y lua-filesystem
robertlzj commented 3 years ago

Hi, nice to see you solve your problem. Then maybe it's good to close issue, it will feel disheartened to see lots of bugs opens. And it's still searchable after close.