lua-users home
lua-l archive

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


If i use your code, i get this:
	hello_world.c:14: error: too many arguments to function `lua_open'

So i  write lua_open() instead of lua_open(0). Than i get this output:
	/usr/local/lib/liblualib.so: undefined reference to `log'
	/usr/local/lib/liblualib.so: undefined reference to `cos'	
	/usr/local/lib/liblualib.so: undefined reference to `sin'
	/usr/local/lib/liblualib.so: undefined reference to `pow'
	/usr/local/lib/liblualib.so: undefined reference to `log10'
	/usr/local/lib/liblualib.so: undefined reference to `exp'
	/usr/local/lib/liblualib.so: undefined reference to `tan'
	/usr/local/lib/liblualib.so: undefined reference to `asin'
	/usr/local/lib/liblualib.so: undefined reference to `acos'
	collect2: ld returned 1 exit status

I have copied the include and lib directories in the same directorie. I did 
"make install". I think their is a problem with that libs. But i dont know 
any solution.



> I think it's a link error. I've got a HelloWorld-program for using Lua/C
> at:
>
> http://members.home.nl/joeijoei/parrot/Hello_Lua
>
> Good luck,
> Klaas-Jan
> ----- Original Message -----
> From: "Johannes Hager" <hager.j@gmx.de>
> To: <lua@bazar2.conectiva.com.br>
> Sent: Tuesday, June 10, 2003 6:43 PM
> Subject: Using Lua in a C program
>
> > Hi,
> >
> > At first sorry for my bad Englisch. I going to use Lua in a C Project but
>
> it
>
> > doesnt work with my gcc. I have downloaded the Lua sources from
>
> www.lua.org
>
> > and installed with help of the install file. The interpreter works but if
>
> i
>
> > try to write a example like that:
> >
> > #include <lua.h>
> >
> > int main(void){
> >     lua_State *L;
> >     L = lua_open();
> >     lua_close(L);
> >     return 0;
> > }
> >
> > comes this:
> >
> > /tmp/ccV9wgqi.o(.text+0x11): In function `main':
> > : undefined reference to `lua_open()'
> >
> > /tmp/ccV9wgqi.o(.text+0x1f): In function `main':
> > : undefined reference to `lua_close(lua_State*)'
> >
> > /tmp/ccV9wgqi.o(.eh_frame+0x11): undefined reference to
>
> `__gxx_personality_v0'
>
> > collect2: ld returned 1 exit status
> >
> > I thing thats a linker error. Anyone a idea?
> >
> > Thanks for your help
> > Cu