linux安裝lua相關編譯報錯

一、報之類的錯誤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

須要安裝

ncurses 

yum install ncurses-devel
 
三、報 lua.c:67:31: fatal error: readline/readline.h: No such file or directory
解決:
說明缺乏libreadline-dev依賴包

centos: yum install readline-devel
debian: apt-get install libreadline-dev.
相關文章
相關標籤/搜索