Can I use the shared library compiled on Ubuntu on a Redhat Linux machine?

I have compiled a shared library on the Ubuntu 9.10 desktop. I want to share with a collaborative developer who has Red Hat Enterprise 5.

Can he use my shared library on his machine?

+3
source share
4 answers

First point: all responses to the compiler version seem to be erroneous. What are the important connections (and, of course, architecture).

.so (, /usr/local/* /opt/*), , LD_PRELOAD, (ld-linux.so) , .

, ( - LD_ * /etc/ld.so.preload ( chroot?), .

, . . Ubuntu Red Hat . ! ( , , , ServerFault SuperUser, SO).

+6

: , , ?

DistroWatch, Ubuntu 9.10 glibc-2.10.1, RHEL-5.4 glibc-2.5. , GLIBC_2.6 , RHEL-5.

, ( ):

readelf -s /path/to/your/library.so | egrep 'GLIBC_2.([6-9]|10)'

, RHEL-5.

, , RHEL-5, autopackage.

+2

. IMHO , Ubuntu RHEL, gcc, glibc. , , , , .

, ( ), , , "" :)

0

- , !!!!

  • Upgrading gcc to the same version as yours
  • Install your version of gcc on your computer and compile it

You should check if you work in the same architecture with 32 bits or 64 bits.

My opinion is that you may have some problems because you probably aren't using the same glibc.

0
source

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


All Articles