BenV's notes

Lua 5.2.3 on Slackware64 14.1

by on Jul.04, 2014, under Software

Just ran into this one, noting it down for anyone else with this error:

Trying to compile Lua 5.2.3 (which should try to invest some in autoconf / cmake or something) gave me this lovely error:

make[2]: Entering directory `/usr/src/lua-5.2.3/src'
gcc -o lua lua.o liblua.a -lm -Wl,-E -ldl -lreadline
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../lib64/libreadline.so: undefined reference to `tputs'
echo Stom product, Makefile editen, dan make MYLIBS="-lncurses" anders breekt ie op readline.
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../lib64/libreadline.so: undefined reference to `tgoto'
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../lib64/libreadline.so: undefined reference to `tgetflag'
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../lib64/libreadline.so: undefined reference to `UP'
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../lib64/libreadline.so: undefined reference to `tgetent'
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../lib64/libreadline.so: undefined reference to `tgetnum'
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../lib64/libreadline.so: undefined reference to `PC'
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../lib64/libreadline.so: undefined reference to `tgetstr'
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../lib64/libreadline.so: undefined reference to `BC'
collect2: error: ld returned 1 exit status
make[2]: *** [lua] Error 1
make[2]: Leaving directory `/usr/src/lua-5.2.3/src'
make[1]: *** [linux] Error 2
make[1]: Leaving directory `/usr/src/lua-5.2.3/src'
make: *** [linux] Error 2

Reason: it needs to link against ncursus in Slackware (or alternatively libtermcap, but ncursus worked for me).
Solution – use make MYLIBS=”-lncursus”:

make MYLIBS="-lncurses"
cd src && make linux
make[1]: Entering directory `/usr/src/lua-5.2.3/src'
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
make[2]: Entering directory `/usr/src/lua-5.2.3/src'
gcc -o lua lua.o liblua.a -lm -Wl,-E -ldl -lreadline -lncurses
gcc -o luac luac.o liblua.a -lm -Wl,-E -ldl -lreadline -lncurses
make[2]: Leaving directory `/usr/src/lua-5.2.3/src'
make[1]: Leaving directory `/usr/src/lua-5.2.3/src'





Leave a Reply

You must be logged in to post a comment.