lua-5.2.3编译问题记录"libreadline.so: undefined reference to `PC'"
来源:互联网 发布:油烟机 知乎 编辑:程序博客网 时间:2024/06/15 14:04
作者:zhanhailiang 日期:2014-10-21
[root@~/software]# cd lua-5.2.3[root@~/software/lua-5.2.3]# make linuxcd src && make linuxmake[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 statusmake[2]: *** [lua] Error 1make[2]: Leaving directory `/root/software/lua-5.2.3/src'make[1]: *** [linux] Error 2make[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 installcd src && make linuxmake[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.2cd src && install -p -m 0755 lua luac /usr/local/bincd src && install -p -m 0644 lua.h luaconf.h lualib.h lauxlib.h lua.hpp /usr/local/includecd src && install -p -m 0644 liblua.a /usr/local/libcd 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 -vLua 5.2.3 Copyright (C) 1994-2013 Lua.org, PUC-Rio
0 0
- lua-5.2.3编译问题记录"libreadline.so: undefined reference to `PC'"
- Lua-5.2.2 在CentOS下提示libreadline.so undefined reference to tputs解决
- libstdc++.so:undefined reference to 'sqrt'、'asin'、'log'编译问题
- libopencv_gpu.so.2.4: undefined reference to 问题
- Openssl-1.0.0c编译报错 libcrypto.so: undefined reference to `ENGINE_load_aep'的问题
- ROS .so载入undefined reference to `dlopen'问题
- caffe编译遇到“libunwind.so.8: undefined reference”问题
- /usr/lib/libreadline.so.5: undefined symbol: PC 错误的处理方法
- /usr/lib/libreadline.so.5: undefined symbol: PC 导致suse 无法启动
- symbol lookup error: /home/caffe/anaconda/lib/libreadline.so.6: undefined symbol: PC
- Ubuntu11.20 32位linux下编译cppunit报 libcppunit.so: undefined reference to `dlsym'错误问题
- 编译出错 "undefined reference to"
- 编译出错 "undefined reference to" .
- libxml2.so.2: undefined reference to `gzopen64'
- ../thelib/libthelib.so: undefined reference to `dlopen'
- /lib/libQtGui.so: undefined reference to `ts_read_raw'
- libQtCore.so: undefined reference to `clock_gettime'
- libxml2.so: undefined reference to `gzopen64'
- android进阶学习
- spring-mvc学习笔记
- maven搭建 SSH
- Two Sum
- 开发项目如一场战争
- lua-5.2.3编译问题记录"libreadline.so: undefined reference to `PC'"
- Network Saboteur (poj 2531 dfs)
- 欢聚时代一面
- lua_tinker浅析
- session和cookie的区别
- Mybatis学习笔记
- 用squid架设cdn简单思路
- Stanford-Machine learning(1)機器學習的動機與應用
- 2011年各大知名IT公司校园招聘研发类薪资待遇收集