Associating an application with libbz2.so.1, not libbz2.so.1.0

Here is the current situation I'm in:

I want to distribute a binary application on Linux that will run on several distributions (not all of them, only the main ones at the moment, allow me to focus on Ubuntu and Fedora for the sake of this discussion). The corresponding application refers to libbz2for some part of its work. A simple "Hello World" will illustrate the situation:

/* main.cpp */
#include <iostream>

int main(int argc, char* argv[])
{
  std::cout << "Hello World!\n";
  return 0;
}

The application is built as such:

g++ -lbz2 -o test.bin main.cpp

Ubuntu. ldd , libbz2.so.1.0 . Fedora, , ldd , libbz2.so.1.0. Fedora libbz2.so.1 libbz2.so.1.0.4, libbz2.so.1.0.

Red Hat Bugzilla , , . libbz2.so.1.0, libbz2.so.1, , .

, ( .so -l ) , . :

g++ /lib/libbz2.so.1 -o test.bin main.cpp

ldd , libbz2.so.1.0, g++.

, Ubuntu , libbz2.so.1, libbz2.so.1.0?

.

+5
2

?

Ubuntu RHEL, , .

+3

, , . ELF -L -l . , , SONAME , , . :

$ objdump -p /lib64/libbz2.so.1 | grep SONAME
  SONAME      libbz2.so.1

, libbz2, . , - :

$ ln -s /lib64/libbz2.so.1 libblah.so
$ g++ t.C -L. -l blah

, libblah, SONAME , libbz2.so.1

$ ldd a.out | grep bz2
        libbz2.so.1 => /lib64/libbz2.so.1 (0x00002b3d1a000000)

( ), - ( glibc SONAME).

+4

All Articles