Chinaunix首页 | 论坛 | 博客
  • 博客访问: 331432
  • 博文数量: 172
  • 博客积分: 2967
  • 博客等级: 少校
  • 技术积分: 1805
  • 用 户 组: 普通用户
  • 注册时间: 2011-09-09 13:31
文章分类

全部博文(172)

文章存档

2014年(6)

2013年(45)

2012年(120)

2011年(1)

我的朋友

分类: Mysql/postgreSQL

2014-01-01 17:42:56

wget 
tar xvf lua-5.2.3.tar.gz
make linux(test machine:centos6.5)
make install

问题:
collect2: ld returned 1 exit status
make[2]: *** [lua] Error 1
make[2]: Leaving directory `/root/lua-5.2.3/src'
make[1]: *** [linux] Error 2
make[1]: Leaving directory `/root/lua-5.2.3/src'
make: *** [linux] Error 2
官方:

Building Lua

In most Unix-like platforms, simply do "make" with a suitable target. Here are the details.

  1. Open a terminal window and move to the top-level directory, which is named lua-5.2.3. The Makefile there controls both the build process and the installation process.


  2. Do "make" and see if your platform is listed. The platforms currently supported are:


    aix ansi bsd freebsd generic linux macosx mingw posix solaris

    If your platform is listed, just do "make xxx", where xxx is your platform name.

    If your platform is not listed, try the closest one or posix, generic, ansi, in this order.


  3. The compilation takes only a few moments and produces three files in the src directory: lua (the interpreter), luac (the compiler), and liblua.a (the library).


  4. To check that Lua has been built correctly, do "make test" after building Lua. This will run the interpreter and print its version string.

If you're running Linux and get compilation errors, make sure you have installed the readline development package. If you get link errors after that, then try "make linux MYLIBS=-ltermcap".

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

主要问题是少一个参数:
-lncurses
--------Ncurses 提供字符终端处理库,包括面板和菜单



阅读(7691) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~