lua-users home
lua-l archive

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


The only thing i have change on your file is 

luaL_openlibs(L); 
instead 
lua_openlibs(L);
and link fine.

-----Mensagem original-----
De: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] Em nome de Alex Queiroz
Enviada em: segunda-feira, 9 de julho de 2007 16:43
Para: Lua list
Assunto: Re: Compiling/Executing problems in C

Hallo,

On 7/9/07, Patrick Donnelly <batrick@hotmail.com> wrote:
>
>
> PIL says the program works with lua 5.1 with minor adjustments (all of
them
> I made). http://www.lua.org/pil/24.1.html (Read the red
> warning)
>
> I have no liblua51.a on my system. I only have liblua.a inside
> /usr/local/lib. I also want to make it clear I never had lua5.0 on this
> system. I just installed lua5.1.2 today!
>
> When I do `gcc mytest.c /usr/local/lib/liblua.a` I get link errors (mostly
> math functions) such as:
>
> /usr/local/lib/liblua.a(lmathlib.o): In function `math_acos':
> lmathlib.c:(.text+0x85e): undefined reference to `acos'
> /usr/local/lib/liblua.a(loadlib.o): In function `ll_loadfunc':
> loadlib.c:(.text+0x937): undefined reference to `dlsym'
>

     Ok, for these two use: -ldl -lm

Cheers,
-- 
-alex
http://www.ventonegro.org/