lua-5.2.3编译问题记录"libreadline.so: undefined reference to `PC'"

  作者:zhanhailiang 日期:2014-10-21
[root@~/software]# cd lua-5.2.3
[root@~/software/lua-5.2.3]# make linux
cd src && make linux
make[1]: Entering directory `/root/software/lua-5.2.3/src‘
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
make[2]: Entering directory `/root/software/lua-5.2.3/src‘
gcc -o lua   lua.o liblua.a -lm -Wl,-E -ldl -lreadline
/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‘
collect2: ld returned 1 exit status
make[2]: *** [lua] Error 1
make[2]: Leaving directory `/root/software/lua-5.2.3/src‘
make[1]: *** [linux] Error 2
make[1]: Leaving directory `/root/software/lua-5.2.3/src‘
make: *** [linux] Error 2

这是由于lua编译依赖readline库,readline库依赖ncurses库。但没有指定。就会出现“没有定义的符合引用”错误。

解决方式是改动${LUA_DIR}/src/Makefile中linux编译target=linux。在SYSLIBS变量中追加‘-lncurses’选项就可以。例如以下:

105 linux:
106         $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -lncurses"

此时又一次运行:

[root@~/software/lua-5.2.3]# make linux install
cd src && make linux
make[1]: Entering directory `/root/software/lua-5.2.3/src‘
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -lncurses"
make[2]: Entering directory `/root/software/lua-5.2.3/src‘
make[2]: Nothing to be done for `all‘.
make[2]: Leaving directory `/root/software/lua-5.2.3/src‘
make[1]: Leaving directory `/root/software/lua-5.2.3/src‘
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

至此,lua-5.2.3成功安装:

[root@~/software/lua-5.2.3/src]# /usr/local/bin/lua -v
Lua 5.2.3  Copyright (C) 1994-2013 Lua.org, PUC-Rio

lua-5.2.3编译问题记录"libreadline.so: undefined reference to `PC'"

时间: 2024-12-21 21:16:49

lua-5.2.3编译问题记录"libreadline.so: undefined reference to `PC'"的相关文章

lua-5.2.3编译问题"/usr/local/lib/libreadline.so: undefined reference to `PC'"

作者:zhanhailiang 日期:2014-10-21 [root@~/software]# cd lua-5.2.3 [root@~/software/lua-5.2.3]# make linux cd src && make linux make[1]: Entering directory `/root/software/lua-5.2.3/src' make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,

linux下开发,解决cocos2d-x中编译出现的一个小问题, undefined reference to symbol '[email protected]@GLIBC_2.2.5'

解决cocos2d-x中编译出现的一个小问题 对于cocos2d-x 2.×中编译中,若头文件里引入了#include "cocos-ext.h",在进行C++编译的时候会遇到例如以下错误: undefined reference to symbol '[email protected]@GLIBC_2.2.5'/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command li

GCC编译uboot出现(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'错误的解决办法

/opt/arm-2010.09/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.1/armv4t/libgcc.a(_bswapsi2.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0' make: *** [u-boot] Error 1 一旦编译uboot出现上述错误,请不要慌张!解决办法官网已经给出,主要解决办法如下: vim 打开./lib_arm/eabi_com

lnmp环境源码编译安装记录

系统:Cenos 6.5 X64 软件: tengine-2.0.3.tar.gz pcre-8.33.tar.bz2 mysql-5.6.12.tar.gz php-5.5.14.tar.bz2 一.安装nginx 1.1 安装nginx所需的pcre-devel库,使nginx支持HTTP Rewrite模块 [[email protected]]# ./configure --prefix=/home/webserver/pcre  && make && make i

解决ndk编译lua时遇到 undefined reference to '__srget'的问题

今天用ndk r10d版本编译lua时,遇到几个错误,提示没有找到__srget 没有定义,于是看了国外的大神的解决方法, 是因为ndk在r10c之后的版本已经将getc函数屏蔽了,所以导致编译器找不到,只能用比较就得ndk去编译,笔者用 ndk r10b成功编译.附上r10b的下载地址:http://pan.baidu.com/s/1boUO775 转载请注明出处, from 博客园HemJohn 解决ndk编译lua时遇到 undefined reference to '__srget'的问

mysql5.7.10 源码编译安装记录 (centos6.4)【转】

一.准备工作 1.1 卸载系统自带mysql 查看系统是否自带MySQL, 如果有就卸载了, 卸载方式有两种yum, rpm, 这里通过yum卸载 rpm -qa | grep mysql //查看系统自带mysql yum -y remove mysql-* //卸载mysql rpm -e --nodeps mysql-5.1.73-3.el6_5.x86_64 //卸载mysql 1.2 卸载系统自带boost,并安装boost_1_59_0 mysql 5.7 依赖于boost_1_59

使用SSD目标检测c++接口编译问题解决记录

本来SSD做测试的Python接口用起来也是比较方便的,但是如果部署集成的话,肯定要用c++环境,于是动手鼓捣了一下. 编译用的cmake,写的CMakeList.txt,期间碰到一些小问题,简单记录一下问题以及解决方法. 当然前提是你本地的caffe环境没啥问题.各种依赖都安好了.. 1.error: 'AnnotatedDatum' has not been declared    AnnotatedDatum* anno_datum); /home/jiawenhao/ssd/caffe/

openwrt编译出错处理记录

1.代码从windows复制过来编译报错处理,参考:http://www.360doc.com/content/13/1016/21/3884271_321966616.shtml 2.编译lua-socket包时出错 2.1 错误消息 undefined reference to `__stack_chk_fail' 2.2 尝试解决方法: 2.2.1 按照2.3.1解决方案将" -fno-stack-protector"加入rule.mk文件中的TARGET_CFLAGS中,仍旧出

错 'Cannot run program "/home/uv/IDE/adt/sdk/platform-tools/adb": error=2, No such file or directory

为linux平台搭建android开发环境的人,您可能会遇到问题,如下面有: 64位置linux安装64位置eclipse和64位置jdk开场后eclipse错误后 ""Cannot run program "/home/uv/IDE/adt/sdk/platform-tools/adb": error=2, No such file or directory",这是由于android-sdk得adb仅仅有32位版本号,所以得安装32位得编译软件. 解决的