Problems with a shared library on Linux

I am trying to compile / link the old piece of software very much on a Linux system, and for some reason I cannot reference the shared library installed on my system.

I get the following error from the linker:

/usr/bin/ld: cannot find -lXaw 

However, 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 links to it are located in / usr / lib btw. Therefore, nothing special.

So there is a library, and ldconfig finds this. What can cause ld to not find the library during the link? As you probably already guessed, I'm completely new to the library.

Any ideas?

+4
source share
4 answers

Linkers may look literally for "libXaw.so". Is it in / usr / lib? If not, you can try adding it as another soft link from libXaw7.so.7.0.0.

+3
source

The reason for symlink btw is to choose the default version for binding in case of several versions, remember that the library name is integrated into the binary file. (which you can see with ldd).

+3
source

Are the -L library directories rewritten and not looked in / usr / lib?

0
source

To link it, you need a .a file, not a .so file, which is a runtime library. A shared object is only useful for a program that is already associated with non-shared parts of the library. It is usually distributed in the ".a" file.

-1
source

Source: https://habr.com/ru/post/1277684/


All Articles