#解压
tar -xzvf lua5.2.2.tar.gz #进入lua5.2.2文件夹
cd lua5.2.2 #执行make
sudo make linux #提示如下错误:
#lua.c:67:31: 致命错误: readline/readline.h:没有那个文件或目录编译中断。 #到网上下载,大小2.2M
sudo wget http://www.sfr-fresh.com/unix/misc/readline-6.1.tar.gz #执行下列操作
tar -zxvf readline-6.1.tar.gz,cd ~~ ./configure && make && make install
sudo ldconfig #下载ncurses安装
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.7.tar.gz
#执行下列操作
tar -xvf ncurses-5.7.tar.gz
cd ncurses-5.7
./configure
make
make install #运行make linux,提示
/usr/local/lib/libreadline.so: undefined reference to `PC'
/usr/local/lib/libreadline.so: undefined reference to `tgetflag'
/usr/local/lib/libreadline.so: undefined reference to `tgetent'
/usr/local/lib/libreadline.so: undefined reference to `UP'
/usr/local/lib/libreadline.so: undefined reference to `tputs'
/usr/local/lib/libreadline.so: undefined reference to `tgoto'
/usr/local/lib/libreadline.so: undefined reference to `tgetnum'
/usr/local/lib/libreadline.so: undefined reference to `BC'
/usr/local/lib/libreadline.so: undefined reference to `tgetstr' #google了一下,解决方案都没好用,后来请教同学,告诉我直接从命令行安装下列包,果真好用了不报错了
sudo apt-get install libreadline6-dev
sudo apt-get install libreadline6-dbg #最后执行make linux,make install
sudo make linux
sudo make install
以上内容转载自http://www.w3hacker.com/?p=500
#####################################################################
安装完成后输入lua报错:lua: symbol lookup error: /usr/local/lib/libreadline.so.6: undefined symbol: PC"
解决办法:
cd /usr/local/lib
mkdir temp
mv libreadline* temp/
ldconfig