Timothy Wall wrote:
On May 8, 2007, at 10:56 AM, Patrick Wright wrote:
Hi
I did some checking and it turns out that you only get library
symlinks on ubuntu when you install the developer packages. Which
means that most programs that depend on dlopen will break on ubuntu
if you don't have the dev packages installed.
What "dev" packages? (I know "dev" is used to distinguish some
packages, but are you referring to any in particular?)
X11 and libc are the ones I've run into. Most development packages have
a 'dev' suffix, and include header files and debug versions of
libraries. On ubuntu, apparently they are also the only ones that
include a symlink from libXXX.so to libXXX.so.N. Since dlopen looks for
an explicit name, it won't find libXXX.so.N without the symlink,
resulting in the UnsatisfiedLinkError.
On my ubuntu install (7.04), /usr/lib/libc.so isn't a symlink, it is a
LD script - and it still fails to find the library. However, telling it
to use libc.so.6 directly works fine.
We could probably tweak Function.findPath() to explicitly fallback to
libfoo.so.* if libfoo.so isn't found. A bit mucky, but better to fix it
in JNA if possible than have it not work for end-users because they
don't have something installed.