[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Linking with -lname key

From: Vict
Subject: Linking with -lname key
Date: Sun, 7 Jun 2020 15:26:01 +1000

Hello. Sorry if I didn't study the documentation well, but I don't understand
the following aspect: why does libtool not link to its own la archives when
linking with a -lname key?
$ ls /usr/local/lib
libmy specifically made it dependent on libfltk and libEGL.
$ readelf -a /usr/local/lib/ | grep NEEDED
 (NEEDED)             Shared library: []
 (NEEDED)             Shared library: []
Let's link a test program with libmy:
$ libtool --tag=CXX --mode=link g++ -o test_app  test_app.o -lmy
test_app does not become dependent on libflt and libEGL (they are not in the
dynamic section labeled "NEEDED".
Linking test_app with absolute path to libmy does:
$ libtool --tag=CXX --mode=link g++ -o test_app  test_app.o
but relying on absolute path is bad. I can’t know in advance
where the library will be installed (/usr/lib, /usr/local/lib, ...).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]