1 下载lua-5.2.0.tar.gz 文件,tar -xzvf lua-5.2.0.tar.gz 解压后,出现lua-5.2.0文件夹,进入
2 由于所ubuntu系统, 编译: sudo make linux
3 在第二步编译到时候,往往会出错,提示没有readline, 此时下载readline-6.1.tar.gz,解压并进入,
./configure配置
sudo make 编译
sudo make install 安装
sudo ldconfig 配置动态链接库
4 第三步后,在进行sudo make linux,这个时候很有可能在报错,提示没有libncurses.so,下载 ncurses-5.7.tar.gz, 解压并进入,
./configure
sudo make
sudo make install
5 第四步后,进行sudo make linux, 此时很有可能会报个错误:
/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 `tgetflag'
/usr/local/lib/libreadline.so: undefined reference to `UP'
/usr/local/lib/libreadline.so: undefined reference to `tgetent'
/usr/local/lib/libreadline.so: undefined reference to `tgetnum'
/usr/local/lib/libreadline.so: undefined reference to `PC'
/usr/local/lib/libreadline.so: undefined reference to `tgetstr'
/usr/local/lib/libreadline.so: undefined reference to `BC'
collect2: ld returned 1 exit status
这个时候到做法是卸载ncurses-5.7,命令: sudo make uninstall,并卸载系统中可能装的 libncurses5-dev 以及 libncursesw5-dev,然后在重新安装 ncurses-5.7
6 第五步成功后,sudo make install, 安装lua