I wonder whether I can compile application on one Linux distribution and use it on another Linux distribution (same CPU architecture). If not what problems I can run into? Only problems which came to my mind are are concerning dynamically linked libraries:

  • Lack of some library or version of library e.g. lack of /usr/lib/qt5.so
  • Can compiler flags be an issue here?

Are there some other possible difficulties?


You should be able to do this in most cases, yes. The only issues I can forsee other than the library issue you mentioned would be distribution-specific file locations, and having that affect your application should be rare indeed.

  • What about compiler flags? – Trismegistos Mar 19 '15 at 15:46
  • 1
    Compiler flags shouldn't have any effect crossing between distributions on like architectures. – John Mar 19 '15 at 16:06

You could easily run a compiled app on every distro which is the same architecture if you compile it statically.

If you compile it dynamically then you would run into problems such as the one you mentioned (missing libs) or more frequently the version of the libs from other distros would be incompatible.

  • What about compiler flags? – Trismegistos Mar 19 '15 at 15:46

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.