tcpdump mailing list archives
pcap shared libraries: inconsistencies across Linux machines
From: Jonathan Gruenhut <jonathan () zetapoint com>
Date: Wed, 13 Jun 2007 19:32:25 +0300
I am working on 2 Linux machines, compiling the same source code, and linking with -lpcap. The programs work fine on
the machines they were compiled on; one uses libpcap.so.0.8.3, and the other uses libpcap.so.0.9.4.
The problem is that I would like to run binaries from each one on the other. I get output such as:
[jonathan@computer83 ~]$ ./program94
./ program94: error while loading shared libraries: libpcap.so.0.9.4: cannot open shared object file: No such file or
directory
(I get the exactly analogous behavior on the other machine, obviously substituting 0.8.3 for 0.9.4.)
To be honest, at this point I’m totally mystified. My (naive) understanding of shared objects in Linux was that as
long as the major version number was the same, the loader should look up whatever is present on the system.
Since I don’t know exactly what information would be most helpful, I’m going to put in one version of everything that
seems relevant. This is without loss of generality: the corresponding data from the other way around is exactly what
one might assume.
First, the system:
[jonathan@computer94 ~]$ uname -a
Linux localhost.localdomain 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:54:20 EDT 2006 i686 i686 i386 GNU/Linux
ldd output:
[jonathan@computer94 ~]$ ldd program83
linux-gate.so.1 => (0x00422000)
libnsl.so.1 => /lib/libnsl.so.1 (0x001f6000)
libpcap.so.0.8.3 => /usr/lib/libpcap.so.0.8.3 (0x00195000)
libc.so.6 => /lib/libc.so.6 (0x00b47000)
/lib/ld-linux.so.2 (0x00178000)
The so files:
[jonathan@computer94 ~]$ ls -l /usr/lib/*pcap*
lrwxrwxrwx 1 root root 12 Jun 13 20:27 /usr/lib/libpcap.so -> libpcap.so.0
lrwxrwxrwx 1 root root 14 Jun 13 21:22 /usr/lib/libpcap.so.0 -> libpcap.so.0.9
lrwxrwxrwx 1 root root 16 May 3 19:03 /usr/lib/libpcap.so.0.9 -> libpcap.so.0.9.4
-rwxr-xr-x 1 root root 168544 Jul 13 2006 /usr/lib/libpcap.so.0.9.4
As it turns out, I’ve gotten it to work by putting libpcap.so.0.8.3 as a symbolic link to libpcap.so.0, but that
strikes me as a thoroughly displeasing solution esthetically.
Thoughts?
Many thanks for any help.
Jonathan
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.
Current thread:
- pcap shared libraries: inconsistencies across Linux machines Jonathan Gruenhut (Jun 13)
- Re: pcap shared libraries: inconsistencies across Linux machines Guy Harris (Jun 13)
- Re: pcap shared libraries: inconsistencies across Jonathan Gruenhut (Jun 17)
- <Possible follow-ups>
- pcap shared libraries: inconsistencies across Linux machines Alexander Dupuy (Jun 16)
- Re: pcap shared libraries: inconsistencies across Linux machines Guy Harris (Jun 13)
