CentOS 5.x安裝Lua 5.2.3 error (MYLIBS=-lncurses)

來源:互聯網
上載者:User

CentOS 5.x安裝Lua 5.2.3 error (MYLIBS=-lncurses)

在CentOS 5.x  中安裝Lua 5.2.3時遇到如下錯誤:

# make linux

gcc -o lua  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 `tputs'
/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 1exit 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
 
解決辦法, 添加 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  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  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 lua-5.2.3]# 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 && install -p -m 0644 lua.1 luac.1 /usr/local/man/man1
[root@db-172-16-3-39 lua-5.2.3]# make test
src/lua -v
Lua 5.2.3  Copyright (C) 1994-2013 Lua.org, PUC-Rio

Lua 語言 15 分鐘快速入門

Lua程式設計(第2版)中文 PDF

Lua程式設計(第二版)閱讀筆記

NetBSD 將支援用 Lua 指令碼開發核心組件

CentOS 編譯安裝 Lua LuaSocket

Programming In Lua 高清PDF中文版 

如何配置一套優雅的Lua開發環境 

Lua 的詳細介紹:請點這裡
Lua 的:請點這裡

本文永久更新連結地址:

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.