• 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.
  • 相关阅读:
    codevs 2149 矩形周长
    codevs 3044 矩形面积求并
    codevs 1293 送给圣诞夜的极光
    codevs 2806 红与黑
    codevs 1536 海战
    codevs 1262 不要把球传我
    codevs 2606 约数和问题
    BZOJ 2301 problem b
    BZOJ 3994 约数个数和
    codevs 1173 最优贸易
  • 原文地址:https://www.cnblogs.com/vanishfan/p/4670418.html
Copyright © 2020-2023  润新知