c++ - How do I compile RHEL5 compatible shared library from RHEL6 machine with GCC 4.4.6? -


note: i'am c# windows developer entering c++/linux world.

i have boost based cross platform c++ code need compile shared library for:

  • windows
  • rhel6
  • rhel5 and
  • solaris

i have windows , rhel6 machines , have built those. solaris build not important.

according this: can use shared library compiled on ubuntu on redhat linux machine?

my rhel6 compiled shared library won't run on rhel5, because following command:

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

returns glibc2.7 dependency:

143: 00000000 0 func global default und eventfd@glibc_2.7 (14)
9069: 00000000 0 func global default und eventfd@@glibc_2.7

i wondering if there way build rhel5 through rhel6 machine? or other proposal do. thanks.

you can link shared library -wl,-rpath,'$origin' , provide required libraries in same directory.

however, if there in library headers use types c++ standard library, asking troubles. users of library have build , link applications using same c++ compiler , standard library.

the portable option provide shared library c api along c++ header-only wrappers, users can build using c++ compiler.


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -