lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi~

I downloaded lua5.1 src and make install it to a ubuntu 10.04 server

I wrote a test program:


#include "lua.h"


int main() {
    lua_State *L;

    L = luaL_newstate();
    luaL_openlibs(L);
    luaL_dofile(L, "test.lua");

    return 1;
}


and use:
gcc test.c -I/home/test/software/lua/include/ -L/home/test/software/lua/lib -llua

to compile it

but got an error:


test.c: In function ‘main’:
test.c:7: warning: assignment makes pointer from integer without a cast
/tmp/cccVEjpP.o: In function `main':
test.c:(.text+0x2e): undefined reference to `luaL_dofile'
/home/test/software/lua/lib/liblua.a(lvm.o): In function `Arith':
lvm.c:(.text+0xa58): undefined reference to `pow'
lvm.c:(.text+0xa78): undefined reference to `floor'
/home/test/software/lua/lib/liblua.a(lvm.o): In function `luaV_execute':
lvm.c:(.text+0x20c2): undefined reference to `floor'
lvm.c:(.text+0x2160): undefined reference to `pow'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_tan':
lmathlib.c:(.text+0x19e): undefined reference to `tan'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_tanh':
lmathlib.c:(.text+0x1de): undefined reference to `tanh'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_sqrt':
lmathlib.c:(.text+0x234): undefined reference to `sqrt'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_sin':
lmathlib.c:(.text+0x27e): undefined reference to `sin'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_sinh':
lmathlib.c:(.text+0x2be): undefined reference to `sinh'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_floor':
lmathlib.c:(.text+0x42e): undefined reference to `floor'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_random':
lmathlib.c:(.text+0x527): undefined reference to `floor'
lmathlib.c:(.text+0x578): undefined reference to `floor'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_pow':
lmathlib.c:(.text+0x608): undefined reference to `pow'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_log':
lmathlib.c:(.text+0x6ae): undefined reference to `log'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_log10':
lmathlib.c:(.text+0x6ee): undefined reference to `log10'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_fmod':
lmathlib.c:(.text+0x832): undefined reference to `fmod'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_exp':
lmathlib.c:(.text+0x85e): undefined reference to `exp'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_cos':
lmathlib.c:(.text+0x89e): undefined reference to `cos'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_cosh':
lmathlib.c:(.text+0x8de): undefined reference to `cosh'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_ceil':
lmathlib.c:(.text+0x91e): undefined reference to `ceil'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_atan':
lmathlib.c:(.text+0x95e): undefined reference to `atan'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_atan2':
lmathlib.c:(.text+0x9b8): undefined reference to `atan2'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_asin':
lmathlib.c:(.text+0x9fe): undefined reference to `asin'
/home/test/software/lua/lib/liblua.a(lmathlib.o): In function `math_acos':
lmathlib.c:(.text+0xa3e): undefined reference to `acos'
/home/test/software/lua/lib/liblua.a(loadlib.o): In function `ll_loadfunc':
loadlib.c:(.text+0xa21): undefined reference to `dlsym'
loadlib.c:(.text+0xa6c): undefined reference to `dlopen'
loadlib.c:(.text+0xa79): undefined reference to `dlerror'
loadlib.c:(.text+0xa91): undefined reference to `dlerror'
/home/test/software/lua/lib/liblua.a(loadlib.o): In function `gctm':
loadlib.c:(.text+0x108e): undefined reference to `dlclose'
/home/test/software/lua/lib/liblua.a(lcode.o): In function `codearith':
lcode.c:(.text+0x1320): undefined reference to `pow'
lcode.c:(.text+0x1347): undefined reference to `floor'
collect2: ld returned 1 exit status




I use "nm liblua.a" to see the symbol table of liblua.a, also can't find luaL_dofile in it.



Thanks