Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1477981
  • 博文数量: 148
  • 博客积分: 2234
  • 博客等级: 大尉
  • 技术积分: 3225
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-17 21:34
个人简介

未来很长。

文章存档

2017年(7)

2016年(4)

2015年(1)

2014年(6)

2013年(31)

2012年(99)

分类: LINUX

2013-10-29 16:15:50

在我们运行C中包含有lua脚本的时候往往会出现一些错误:

/usr/bin/ld: /usr/local/lib/liblua.a(lapi.o):

relocation R_X86_64_32 against `luaO_nilobject_' can not be used when making a shared object;

recompile with -fPIC

/usr/local/lib/liblua.a: could not read symbols: Bad value


这个时候以下面的这个例子来说吧:

tar zxvf lua-5.1.4.tar.gz

cd lua-5.1.4

如果你的服务器是64位的,这时要调整一下Makefile:vi src/Makefile,在CFLAGS里加上-fPIC,否则会出错:

/usr/bin/ld: /usr/local/lib/liblua.a(lapi.o):

relocation R_X86_64_32 against `luaO_nilobject_' can not be used when making a shared object;

recompile with -fPIC

/usr/local/lib/liblua.a: could not read symbols: Bad value

接下来不用执行常见的configure,直接make:

make linux

make install

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