lua-users home
lua-l archive

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


On Mon, Jan 19, 2009 at 5:48 PM, Wesley Smith <wesley.hoke@gmail.com> wrote:
>> Probably your package.cpath doesn't include /usr/local/lib.
>
> So let me get this straight because there's potential for confusion:

Indeed. You didn't mention two .so files in your original post. A
better description of your problem might get more specific advice.

> I have the following:
>
> muro.so (lua module)
> libmuro.so (generic dylib)
>
> When I require("muro"), muro.so loads fine, but muro.so depends on

What do you mean by "loads fine"? It can't be that fine, if it ain't working!

What happens? How about some lua code, and some console output? gdb
stack trace? Something?

> libmuro.so.  The trouble I'm having is loading libmuro.so, which is in
> /usr/local/lib as it should be since it's a lib I made and isn't a Lua
> module.  Does adding /usr/local/lib to the cpath really allow dlopen
> to find the dependencies that binary lua modules might have?

package.cpath helps lua find muro.so in order to dlopen it.

Is lua finding muro.so? If not, your package.cpath needs work.

dlopen uses ld to resolve references in muro.so.

Is ld resolving refs? When you run ldd on muro.so, what does it say?
It should say muro.so depends on libmuro.so, and print the full path
to libmuro.so. If it doesn't, your ld configuration or cache needs
work.

Or maybe the name of the muro.so entry point is wrong? So many possibilities.

Sam

-- 
Ars longa, vita brevis, occasio praeceps, experimentum periculosum,
iudicium difficile.