compiling 5.0

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

compiling 5.0

Brian Ronk
I would like to experiment with Lua some, and downloaded the Lua 
5.0 sources for Linux.  I have Mandrake 9 on my machine.  I 
compiled everything with no problems, did shared libraries, and did 
a make install for everything.  But when I run lua, it gives an error 
that it can't find a library.  (Unfortunetly, I don't have the message at 
the moment, I'll get it at lunch)  I followed the directions in the 
INSTALL file, but I must have done something wrong.  Does anyone 
have any ideas?  Thanks.

Brian Ronk

Reply | Threaded
Open this post in threaded view
|

Re: compiling 5.0

Luiz Henrique de Figueiredo
>But when I run lua, it gives an error that it can't find a library.
>[...] I followed the directions in the INSTALL file, but I must have
>done something wrong.i

Try setting LD_LIBRARY_PATH to the full path of where the Lua libraries are.
--lhf

Reply | Threaded
Open this post in threaded view
|

Linking Issues

Eric Merritt
In reply to this post by Brian Ronk
Hello all,

 I am trying to link a up to the lua runtime. As you
can see in the errors below I am getting undefined
references to a few lua functions. This is a bit weird
because all of the undefined references point to
functions in lualib, it seems that the lua library is
linking in just fine. Now lualib exists and is in the
same dir (/usr/local/lib) as the lua library. So I am
really unsure as to why these errors occure. I
searched the archive and the only time I found a
similar problem the user was using C++ not C and he
forgot the extern C around the include for lua. This
cannot be my problem because I am using strait C. It
would be great if one of you could offer suggestions.
Btw, I am using Redhat 8.0 and Lua 5.0. I compiled
these myself via the standard make process.

Thanks,
Eric

-->

GSLuaInterp.o: In function `_i_GSLuaInterp__init':
GSLuaInterp.o(.text+0x17): undefined reference to
`lua_openbase'
GSLuaInterp.o(.text+0x22): undefined reference to
`lua_openio'
GSLuaInterp.o(.text+0x2d): undefined reference to
`lua_openmath'
GSLuaInterp.o(.text+0x38): undefined reference to
`lua_openstring'
GSLuaInterp.o: In function
`_i_GSLuaInterp__loadFile_':
GSLuaInterp.o(.text+0x81): undefined reference to
`lua_loadFile'
collect2: ld returned 1 exit status

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

Reply | Threaded
Open this post in threaded view
|

Re: Linking Issues

Peter Shook-5
You need to include lualib.h to convert from the old names to the new ones:

 lua_baselibopen	luaopen_base
 lua_tablibopen	luaopen_table
 lua_iolibopen	luaopen_io
 lua_strlibopen	luaopen_string
 lua_mathlibopen	luaopen_math
 lua_dblibopen	luaopen_debug

Eric Merritt wrote:
Hello all,

 I am trying to link a up to the lua runtime. As you
can see in the errors below I am getting undefined
references to a few lua functions. This is a bit weird
because all of the undefined references point to
functions in lualib, it seems that the lua library is
linking in just fine. Now lualib exists and is in the
same dir (/usr/local/lib) as the lua library. So I am
really unsure as to why these errors occure. I
searched the archive and the only time I found a
similar problem the user was using C++ not C and he
forgot the extern C around the include for lua. This
cannot be my problem because I am using strait C. It
would be great if one of you could offer suggestions.
Btw, I am using Redhat 8.0 and Lua 5.0. I compiled
these myself via the standard make process.

Thanks,
Eric



Reply | Threaded
Open this post in threaded view
|

Re: Linking Issues

Eric Merritt
Peter,

 Thanks Peter I was actually mis-forming the luaopen_*
as lua_open* which cuase the linking errors. So what
this proves is that I am a complete idiot who should
take a closer look at the documentation before
submitting questions to the list ;) 

 Its always the little things that get me.

Thanks,
Eric

--- Peter Shook <[hidden email]> wrote:
> You need to include lualib.h to convert from the old
> names to the new ones:
> 
>   lua_baselibopen	luaopen_base
>   lua_tablibopen	luaopen_table
>   lua_iolibopen	luaopen_io
>   lua_strlibopen	luaopen_string
>   lua_mathlibopen	luaopen_math
>   lua_dblibopen	luaopen_debug
> 
> Eric Merritt wrote:
> > Hello all,
> > 
> >  I am trying to link a up to the lua runtime. As
> you
> > can see in the errors below I am getting undefined
> > references to a few lua functions. This is a bit
> weird
> > because all of the undefined references point to
> > functions in lualib, it seems that the lua library
> is
> > linking in just fine. Now lualib exists and is in
> the
> > same dir (/usr/local/lib) as the lua library. So I
> am
> > really unsure as to why these errors occure. I
> > searched the archive and the only time I found a
> > similar problem the user was using C++ not C and
> he
> > forgot the extern C around the include for lua.
> This
> > cannot be my problem because I am using strait C.
> It
> > would be great if one of you could offer
> suggestions.
> > Btw, I am using Redhat 8.0 and Lua 5.0. I compiled
> > these myself via the standard make process.
> > 
> > Thanks,
> > Eric
> > 
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com