[vlc-devel] reenabling java bindings

Filippo Carone filippo at carone.org
Fri Dec 12 23:44:49 CET 2008

Olivier Aubert ha scritto:
> On Fri, 2008-12-12 at 14:33 +0100, Rémi Denis-Courmont wrote:
>>> There's surely something I'm missing in the way java loads libraries,
>>> since checking the java source code I've seen it uses dlopen (are there
>>> any other means to load a library?).
>> Link at build time, and let the run-time linker do the job.
>> That's how VLC loads libvlc, and how libvlc loads libvlccore.
> libvlc does not dlopen(libvlccore) explicitly. libtool does its job, and
> libvlc is simply compiled against -lvlccore, which the loader resolves
> at runtime.
> With your approach, all other mentionned systems (java bindings, python
> bindings, mozilla plugin) should have to explicitly load libvlcore with
> something like
> if (!dlopen ("libvlccore.so", RTLD_NOW | RTLD_GLOBAL))
>   printf ("\n%s\n", dlerror());
> (with an additional #define to use .dll instead of .so for windows, etc).

After some experiments, dlopening libvlc in the RTLD_GLOBAL is enough. I 
sent a patch to the jna team in order to give the user the possibility 
to load a native library with that option. Let's hope it gets approved fast.


More information about the vlc-devel mailing list