lua-users home
lua-l archive

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


Am 23.06.2010 15:02, schrieb Antonio Scuri:
>   Hi,

Hi!

> 
>   I have two modules. One is straight forward to build. But the second one
> depends on C functions that were implemented in the first module.
> 
>   So when linking the second module in Linux I have to add the first module
> using "-lmodule1". But it fails, because the first module is called
> "module1.so" and not "libmodule1.so".
> 
>   I know there are "alternative" solutions, like creating a symbolic link
> (but do I have to distribute the link? I check using ldd that it depends on
> the link, not to the actual file. Ugly...), or use standard names and change
> the LUA_CPATH (like I do in IUP). Or even build a base library to store
> those functions and link both libraries to that library, but that's nonsense
> just to store a couple of functions.
> 
>   So I would like to know if there are other solutions. I searched the Wiki
> with no success.

What about moving the shared functions to a separate libwhatever.so and
linking both modules to this library?

Or put a struct of function pointers into the Lua registry and call the
shared functions via the function pointers...

> 
> Thanks,
> Scuri
> 

HTH,
Philipp