CentOS 5.x install Lua 5.2.3 error (MYLIBS =-lncurses)
When Lua 5.2.3 is installed in CentOS 5.x, the following error occurs:
# Make linux
Gcc-o lua. o liblua. a-lm-Wl,-E-ldl-lreadline
/Usr/lib/gcc/x86_64-RedHat-linux/4.1.2/.../../lib64/libreadline. so: undefined reference to 'pc'
/Usr/lib/gcc/x86_64-redhat-linux/4.1.2/.../../lib64/libreadline. so: undefined reference to 'tgetflag'
/Usr/lib/gcc/x86_64-redhat-linux/4.1.2/.../../lib64/libreadline. so: undefined reference to 'tgetent'
/Usr/lib/gcc/x86_64-redhat-linux/4.1.2/.../../lib64/libreadline. so: undefined reference to 'up'
/Usr/lib/gcc/x86_64-redhat-linux/4.1.2/.../../lib64/libreadline. so: undefined reference to 'put'
/Usr/lib/gcc/x86_64-redhat-linux/4.1.2/.../../lib64/libreadline. so: undefined reference to 'tgoto'
/Usr/lib/gcc/x86_64-redhat-linux/4.1.2/.../../lib64/libreadline. so: undefined reference to 'tgetnum'
/Usr/lib/gcc/x86_64-redhat-linux/4.1.2/.../../lib64/libreadline. so: undefined reference to 'bc'
/Usr/lib/gcc/x86_64-redhat-linux/4.1.2/.../../lib64/libreadline. so: undefined reference to 'tgetstr'
Collect2: ld returned 1 exit status
Make [2]: *** [lua] Error1
Make [2]: Leaving directory '/opt/soft_bak/lua-5.2.3/src'
Make [1]: *** [linux] Error 2
Make [1]: Leaving directory '/opt/soft_bak/lua-5.2.3/src'
Make: *** [linux] Error 2
Solution: Add MYLIBS =-lncurses
[Root @ db-172-16-3-39 lua-5.2.3] # make linux MYLIBS =-lncurses
Cd src & make linux
Make [1]: Entering directory '/opt/soft_bak/lua-5.2.3/src'
Make all SYSCFLAGS = "-DLUA_USE_LINUX" SYSLIBS = "-Wl,-E-ldl-lreadline"
Make [2]: Entering directory '/opt/soft_bak/lua-5.2.3/src'
Gcc-o lua. o liblua. a-lm-Wl,-E-ldl-lreadline-lncurses
Gcc-O2-Wall-DLUA_COMPAT_ALL-DLUA_USE_LINUX-c-o luac. o luac. c
Gcc-o luac. o liblua. a-lm-Wl,-E-ldl-lreadline-lncurses
Make [2]: Leaving directory '/opt/soft_bak/lua-5.2.3/src'
Make [1]: Leaving directory '/opt/soft_bak/lua-5.2.3/src'
[Root @ db-172-16-3-39] # make install
Cd src & mkdir-p/usr/local/bin/usr/local/include/usr/local/lib/usr/local/man/man1/usr/local/share/ lua/5.2/usr/local/lib/lua/5.2
Cd src & install-p-m 0755 lua luac/usr/local/bin
Cd src & install-p-m 0644 lua. h luaconf. h lualib. h lauxlib. h lua. hpp/usr/local/include
Cd src & install-p-m 0644 liblua. a/usr/local/lib
Cd doc & amp; install-p-m 0644 lua.1 luac.1/usr/local/man/man1
[Root @ db-172-16-3-39] # make test
Src/lua-v
Lua 5.2.3 Copyright (C) 1994-2013 Lua.org, PUC-Rio
Lua Language 15-minute Quick Start
Lua programming (version 2nd) Chinese PDF
Lua programming (version 2) Reading Notes
NetBSD will support the use of Lua scripts to develop Kernel Components
CentOS compilation and installation of Lua LuaSocket
Programming In Lua PDF
How to configure an elegant Lua Development Environment
Lua details: click here
Lua's: click here
This article permanently updates the link address: