一、報之類的錯誤html
/usr/lib/libreadline.so: undefined reference to `PC' /usr/lib/libreadline.so: undefined reference to `tgetflag' /usr/lib/ibreadline.so: undefined reference to `tgetent' /usr/lib/libreadline.so: undefined reference to `UP' /usr/lib/libreadline.so: undefined reference to `tputs' /usr/lib/libreadline.so: undefined reference to `tgoto' /usr/lib/libreadline.so: undefined reference to `tgetnum' /usr/lib/libreadline.so: undefined reference to `BC'
解決: linux
因爲lua編譯依賴readline
庫,而其依賴ncurses
庫,但沒有指定,因此出現「未定義的符合引用」錯誤。須要修改${LUA_DIR}/src/Makefile
中linux編譯target,在SYSLIBS變量中追加‘-lncurses’選項便可。修改後,以下:centos
linux:lua
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -lncurses".net
二、報cannot find -lncurses unix
解決:
code
說明缺乏libreadline-dev依賴包 centos: yum install readline-devel debian: apt-get install libreadline-dev.