VLCJ and libvlc.so

This forum is about all development around libVLC.
rogrogg
New Cone
New Cone
Posts: 3
Joined: 06 Dec 2013 22:43

VLCJ and libvlc.so

Postby rogrogg » 06 Dec 2013 22:55

I have two Linux boxes. On one (LinuxBox1), I built VLC from source.

My VLCJ java application adds varous paths on which to look for libvlc.so using the NativeLibrary.addSearchPath() method, after which it calls the Native.loadLibrary().

My application runs just fine on LinuxBox1. On LinuxBox2, however, I have only the copied libvlc.so and libvlccore.so files along with my java application. When I attempt to run on LinuxBox2 I repeatedly get the VLCJ error Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'libvlc': ...stack trace...

I've played around extensively with the LD_LIBRARY_PATH variable, to point to the .so's in various locations, I've passed the -Djna.library.path=[path] args to my java app, I've even added multiple paths to within my app so that it will look in multiple locations. With every attempt, however, I get the same exception. Interestingly enough I've played around on LinuxBox1 and tried each of the above mentioned techniques with success on LinuxBox1.

Is the fact that i built the binaries on LinuxBox1 have something to do with the reason LinuxBox2 cannot find the appropriate libraries? I have moderate experience with linux development in general, but little with JNA. I'm at a dead end.

Please advise.

Thanks

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: VLCJ and libvlc.so

Postby sherington » 07 Dec 2013 11:03

I do not profess to fully understand run-time linking on Linux, and I don't have a satisfactory answer for you, but I can tell you what I've seen...

When I build vlc on Linux, the shared library path gets "baked in" to the shared objects, leading to what you've seen where you can't just copy the files around to any old directory and expect it still to work.

So then, again this is *my* understanding, you can try to use LD_LIBRARY_PATH to resolve the new directory, and that's assuming the architecture is the same on both of your Linux boxes of course. I think I've had that working before, but it's a been a while so I might be mistaken.

The issue you're having is really a general issue, it is nothing that specifically relates to vlc nor JNA. So you might be able to find a general solution instead of focussing on vlc.

It's certainly not like Windows where copying DLLs around works.

rogrogg
New Cone
New Cone
Posts: 3
Joined: 06 Dec 2013 22:43

Re: VLCJ and libvlc.so

Postby rogrogg » 26 Dec 2013 17:37

In case anyone stumbles into this thread with a similar issue I wanted to follow up with my findings.

I have no idea why my library wasn't being found still. However, I did find that when I went to the trouble of building VLC from source on Linuxbox2, the issue was resolved once it was found in the prefix (install) folder (/usr/local/lib).

Additional Note, I expect that even once it had found libvlc.so that I'd have had additional issues as I hadn't also copied the plugins folder with additional .so libraries.

Good luck.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 2 guests