问题

$ tar xzf luasocket-2.0.2.tar.gz
$ cd luasocket-2.0.2
$ $ make
cd src; make all
make[1]: Entering directory `/home/lzz/softs/luasocket-2.0.2/src'
gcc  -DLUASOCKET_DEBUG  -pedantic -Wall -O2 -fpic   -c -o luasocket.o luasocket.c
luasocket.c:20:17: fatal error: lua.h: No such file or directory
 #include "lua.h"
                 ^
compilation terminated.
make[1]: *** [luasocket.o] Error 1
make[1]: Leaving directory `/home/lzz/softs/luasocket-2.0.2/src'
make: *** [all] Error 2

解决方法

  • 自己制定lua .h文件的目录就好了
make LUAINC=-I/usr/include/lua5.1/
$ sudo make install

参考:sof

04-16 15:14