ubuntu 下运行lua

来源:互联网 发布:工具书软件 编辑:程序博客网 时间:2024/06/07 21:10


系统版本 : Ubuntu 12.04.2 LTS

lua版本:Lua 5.2.0


安装完 lua 后 出现 编译 链接 lua库的c文件,出现一堆错误

lvm.c:(.text+0x16d8): undefined reference to `pow'
/usr/local/lib/liblua.a(lmathlib.o): In function `math_tan':

lmathlib.c:(.text+0x16c): undefined reference to `tan'
/usr/local/lib/liblua.a(lmathlib.o): In function `math_tanh':
lmathlib.c:(.text+0x1ac): undefined reference to `tanh'
/usr/local/lib/liblua.a(lmathlib.o): In function `math_sqrt':
lmathlib.c:(.text+0x20e): undefined reference to `sqrt'
/usr/local/lib/liblua.a(lmathlib.o): In function `math_sin':
lmathlib.c:(.text+0x23c): undefined reference to `sin'
/usr/local/lib/liblua.a(lmathlib.o): In function `math_sinh':
lmathlib.c:(.text+0x27c): undefined reference to `sinh'


这主要是未链接库的原因

gcc firstLua.c -llua -lm -ldl


这样就没问题了



0 0
原创粉丝点击