Linking third-party shared libraries without soname, linker name

Installing liboost-dev on Debian Squeeze gives me several libraries, such as /usr/lib/libboost_thread.so.1.42.0, but not libboost_thread.so. Now I cannot bind using the -lgcc / ld flag because the names do not end with .so.

I noticed that it /usr/libhas many other form libraries libfoo.so.Nwithout libfoo.so, so this is not peculiar to Boost. In the end, I added links libboost_thread.so.1and libboost_thread.sosymbolic links. (The manual page for ldconfigit assumes that it will add links, but did nothing).

Everything works fine, but it feels dirty. What was I supposed to do?

  • use one more specific version of the linker that I have not found yet (due to the fact that my make files depend on a specific version number).
  • just add symbolic links manually (at the risk of falling under package management).
  • some other Debian "right way" for this.
+3
source share
1 answer

You have installed the runtime package libboost-thread1.42.0, but the development is package libboost-thread-dev(or even catch-all libboost-all-dev.

Once you have the appropriate package -dev, the link will work. This is a common feature of most Linux distributions - you almost never want to get involved with symbolic links manually.

: :

edd@max:~$ ls -l /usr/lib/libboost_thread.*
-rw-r--r-- 1 root root 176324 2010-10-21 00:56 /usr/lib/libboost_thread.a
lrwxrwxrwx 1 root root     25 2011-05-14 10:17 /usr/lib/libboost_thread.so -> \
                                                        libboost_thread.so.1.42.0
-rw-r--r-- 1 root root  88824 2010-10-21 00:56 /usr/lib/libboost_thread.so.1.42.0
edd@max:~$ dpkg -S /usr/lib/libboost_thread.so
libboost-thread1.42-dev: /usr/lib/libboost_thread.so
edd@max:~$ 

, .

+2

All Articles