Nils Pipenbrinck
Nils Pipenbrinck

Reputation: 86313

shared library problems on linux

I'm trying to compile/link a very old piece of software on a linux system and I can't for some reason link with a shared library that's installed on my system.

I get the following error from the linker:

/usr/bin/ld: cannot find -lXaw

However, the lib itself is installed. If I run

ldconfig -v | grep libXaw

I get (among other things) this hit:

libXaw.so.7 -> libXaw7.so.7.0.0

The library and the links to it are in /usr/lib btw. So nothing special.

So the library is there and ldconfig finds it. What could ld cause ld from not finding the library during link-time? As you may have already guessed I'm quite new to the shared library stuff.

Any ideas?

Upvotes: 4

Views: 1987

Answers (4)

Marco van de Voort
Marco van de Voort

Reputation: 26358

The reason for the symlink btw is to select the default version to link against in the case of multiple versions, keep in mind the name of the library is integrated into the binary. (which you can see with ldd).

Upvotes: 3

HUAGHAGUAH
HUAGHAGUAH

Reputation: 1071

Are the -L library directories being overridden, and it's not looking in /usr/lib?

Upvotes: 0

MarkR
MarkR

Reputation: 63538

To link it, you need the .a file, NOT the .so file, which is the runtime library. The shared object is only useful to a program already linked against the non-shared parts of a library. This is typically distributed in a ".a" file.

Upvotes: -1

ejgottl
ejgottl

Reputation: 2829

The linker may be looking, literally, for "libXaw.so". Is that in /usr/lib? If not, you could try adding it as another soft link from libXaw7.so.7.0.0.

Upvotes: 3

Related Questions