zoukankan      html  css  js  c++  java
  • linux安装lua相关编译报错

    1、报之类的错误

    /usr/lib/libreadline.so: undefined reference to `PC'
    /usr/lib/libreadline.so: undefined reference to `tgetflag'
    /usr/lib/ibreadline.so: undefined reference to `tgetent'
    /usr/lib/libreadline.so: undefined reference to `UP'
    /usr/lib/libreadline.so: undefined reference to `tputs'
    /usr/lib/libreadline.so: undefined reference to `tgoto'
    /usr/lib/libreadline.so: undefined reference to `tgetnum'
    /usr/lib/libreadline.so: undefined reference to `BC'

    解决: 

    由于lua编译依赖readline库,而其依赖ncurses库,但没有指定,所以出现“未定义的符合引用”错误。需要修改${LUA_DIR}/src/Makefile中linux编译target,在SYSLIBS变量中追加‘-lncurses’选项即可。修改后,如下:

    linux:

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

    2、报cannot find -lncurses 

    解决:

    需要安装

    ncurses 

    yum install ncurses-devel
     
    3、报 lua.c:67:31: fatal error: readline/readline.h: No such file or directory
    解决:
    说明缺少libreadline-dev依赖包
    
    centos: yum install readline-devel
    debian: apt-get install libreadline-dev.
  • 相关阅读:
    B.Little Sub and Triples
    A.Little Sub and Applese
    1003 超级无敌简单题[暴力打表]
    1002 人类史上最大最好的希望事件[前缀和]
    1001 hzy 和zsl 的生存挑战
    Computer Arrangement [经典贪心]
    Linux指令
    LInux
    Servlet
    El表达式与JSTL表达式
  • 原文地址:https://www.cnblogs.com/daochong/p/7308040.html
Copyright © 2011-2022 走看看