1

I want to develop a C++ library that can be used on multiple Linux distributions like RHEL, Suse, Ubuntu etc...

If I compile my source code into a .so (shared library) on one Linux environment(say RHEL), will it work on other environments also without being recompiled?

Are the gcc and C/C++ libraries different in different environments?

1

If I compile my source code into a .so (shared library) on one Linux environment(say RHEL), will it work on other environments also without being recompiled?

In general, no. You want to use a build system that supports portability. Autotools is the standard. An alternative is Cmake.

  • Thanks for the answer, how can Autotools/Cmake generate distribution neutral builds. Sorry, I am new to Linux world. – Ravi Chandra Nov 18 '14 at 12:55
  • @RaviChandra Kind of big question, and can't be easily answered in a few words, sorry. Do a search for documentation for autotools (automake, autoconf, libtool) and cmake. – Faheem Mitha Nov 18 '14 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.