2

I've run into this problem a few times now. I have some program that is looking for a library and can't find it, even though it is in /usr/lib/x86_64-linux-gnu.

Maybe this a flaw in the way the dependent program was written. I don't know much about this, but I would expect the dependent program to specify the name of the library, and let the system search a list of paths.

Can anyone explain briefly how Ubuntu expects a properly behaved program to look for dynamic libraries?

As a concrete example, the latest case involves the libpcsclite.so library. The Oracle documentation suggests that Java (the dependent program) will look in /usr/lib64 and /usr/local/lib64 on my system—neither of which exist. I've had similar problems in the past with non-Java dependents. Part of my question is, why would a program list search locations like this? Is there a search mechanism provided by Linux that should be used instead?

Is this a problem with Java, to be corrected by using its sun.security.smartcardio.library system property, or is pcsclite failing to support the multi-architecture naming conventions correctly? If the latter, should I be creating symlinks manually, or is this something a tool like ldconfig should fix?

erickson
  • 121

1 Answers1

0

My guess is that the problem is you are installing packages outside of apt (apt-get). Either use Ubuntu packages (ppa if possible) or if you are compiling packages, as you compile, use ./configure --help and specify a library path as a part of your configuration.

See also:

http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

http://www.linuxquestions.org/questions/linux-general-1/using-a-non-standard-library-path-when-compiling-software-781185/

From the second link:

CFLAGS="-I/path/to/your/headers" LDFLAGS="-L/path/to/your/lib" ./configure --blah

If you need further assistance you will have to be more specific regarding "some program that is looking for a library and can't find it" - What program? How did you install it ? etc.

To set your java environment, edit ~/.pam_environment, add:

export JAVA_HOME=/usr/java/<your version of java>
export PATH=${PATH}:${JAVA_HOME}/bin

For all users (system) edit /etc/environment

See also: https://help.ubuntu.com/community/EnvironmentVariables#Persistent_environment_variables

Panther
  • 104,528