2013-12-10 6 views
0
내가 루아에 대한 luasocket 모듈을 설치하고있어

, 그러나 나는 다음과 같은 오류 메시지가있어 :luasocket.c : 20 : 17 : 오류 : lua.h : 해당 파일이나 디렉토리

[[email protected] local]# wget http://files.luaforge.net/releases/luasocket/luasocket/luasocket-2.0.2/luasocket-2.0.2.tar.gz 
[[email protected] local]# tar zxvf luasocket-2.0.2.tar.gz 
[[email protected] local]# cd luasocket-2.0.2 
[[email protected] luasocket-2.0.2]# make && make install 
cd src; make all 
make[1]: Entering directory `/usr/local/luasocket-2.0.2/src' 
gcc -DLUASOCKET_DEBUG -pedantic -Wall -O2 -fpic -c -o luasocket.o luasocket.c 
luasocket.c:20:17: error: lua.h: No such file or directory 
luasocket.c:21:21: error: lauxlib.h: No such file or directory 
luasocket.c:24:24: error: compat-5.1.h: No such file or directory 
In file included from luasocket.c:30: 
luasocket.h:30: error: expected ‘)’ before ‘*’ token 
In file included from luasocket.c:31: 
auxiliar.h:37: error: expected ‘)’ before ‘*’ token 
auxiliar.h:38: error: expected ‘)’ before ‘*’ token 
auxiliar.h:39: error: expected ‘)’ before ‘*’ token 
auxiliar.h:40: error: expected ‘)’ before ‘*’ token 
auxiliar.h:41: error: expected ‘)’ before ‘*’ token 
auxiliar.h:42: error: expected ‘)’ before ‘*’ token 
auxiliar.h:43: error: expected ‘)’ before ‘*’ token 
auxiliar.h:44: error: expected ‘)’ before ‘*’ token 
auxiliar.h:45: error: expected ‘)’ before ‘*’ token 
auxiliar.h:46: error: expected ‘)’ before ‘*’ token 
In file included from luasocket.c:32: 
except.h:33: error: expected ‘)’ before ‘*’ token 
In file included from luasocket.c:33: 
timeout.h:19: error: expected ‘)’ before ‘*’ token 
timeout.h:26: error: expected ‘)’ before ‘*’ token 
In file included from luasocket.c:34: 
buffer.h:39: error: expected ‘)’ before ‘*’ token 
buffer.h:41: error: expected ‘)’ before ‘*’ token 
buffer.h:42: error: expected ‘)’ before ‘*’ token 
buffer.h:43: error: expected ‘)’ before ‘*’ token 
buffer.h:44: error: expected ‘)’ before ‘*’ token 
In file included from luasocket.c:35: 
inet.h:27: error: expected ‘)’ before ‘*’ token 
inet.h:35: error: expected ‘)’ before ‘*’ token 
inet.h:36: error: expected ‘)’ before ‘*’ token 
In file included from luasocket.c:36: 
tcp.h:34: error: expected ‘)’ before ‘*’ token 
In file included from luasocket.c:37: 
udp.h:31: error: expected ‘)’ before ‘*’ token 
In file included from luasocket.c:38: 
select.h:15: error: expected ‘)’ before ‘*’ token 
luasocket.c:43: error: expected ‘)’ before ‘*’ token 
luasocket.c:44: error: expected ‘)’ before ‘*’ token 
luasocket.c:45: error: expected ‘)’ before ‘*’ token 
luasocket.c:50: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘mod’ 
luasocket.c:60: warning: ISO C does not allow extra ‘;’ outside of a function 
luasocket.c:62: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘func’ 
luasocket.c:66: warning: ISO C does not allow extra ‘;’ outside of a function 
luasocket.c:71: error: expected ‘)’ before ‘*’ token 
luasocket.c:80: error: expected ‘)’ before ‘*’ token 
luasocket.c:89: error: expected ‘)’ before ‘*’ token 
luasocket.c:113: error: expected ‘)’ before ‘*’ token 
make[1]: *** [luasocket.o] Error 1 
make[1]: Leaving directory `/usr/local/luasocket-2.0.2/src' 
make: *** [all] Error 2 

아무도 나를 도와 드릴까요 ? 미리 감사드립니다 :)

+0

'lua.h'는 루아 C 소스 코드의 메인 헤더 파일입니다. Lua 소스가 설치되어 있지 않거나 컴파일러에게 어디에서 찾을 수 있는지 알려주지 않았다. – Roddy

답변

4

LUAINC을 설정해야합니다.

사용중인 OS를 지정하지 않았으므로 답을 어떻게 설정할 지 알려 드릴 수 없습니다.

: 당신이 Lua5.1에 대한 을 구축하려는 경우 데비안에서, 당신은 ( makefile에서 포함) config을 편집하거나 명령 줄에 지정하여 변수를 설정할 수 있습니다 -I/usr/include/lua5.1/

로 설정

$ make LUAINC=-I/usr/include/lua5.1/ 
+0

내가 LUAINC를 설정 한 후에도 효과가있었습니다! 많은 감사합니다. –

0

Alpine 3.4를 사용하면 권장 솔루션이 작동하지 않습니다. 이 환경에서 작동하게하려면 패키지를 다운로드하고 다음을 해킹해야했습니다.

luasec-luasec-0.6/src/luasocket/usocket.h 

/* TODO: ifdef the ALPINE #include <sys/poll.h> */ 
#include <poll.h> 

는 다음 메이크

에 다른 사람이 특정 문제에 붙어 경우이 도움이
# Inform the location to install the modules 
LUAPATH ?= /usr/local/share/lua/5.1 
LUACPATH ?= /usr/local/lib/lua/5.1 


# Edit the lines below to inform new path, if necessary. 
# Path below points to internal LuaSocket's help files. 
LUAINCDIR = -I/usr/local/api-gateway/luajit/include/luajit-2.1 
INC_PATH ?= -I/usr/include 
LIB_PATH ?= -L/usr/lib 
INCDIR = -I. $(LUAINCDIR) $(INC_PATH)  <------ include new path 
LIBDIR = -L./luasocket $(LIB_PATH) 

희망을 변경합니다.