Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Static library portability

Tags:

Short question. If I have written C++ static library and compiled it using G++ on Ubuntu, can I assume safely that it will be possible to link it using G++ on other distributions of Linux?

like image 502
Akasata Akasata Avatar asked Sep 08 '18 19:09

Akasata Akasata


1 Answers

Binaries aren't arbitrarily interchangeable amongst linux systems, no matter if executables, static libraries or shared libraries.

That's why almost all software packages are distributed as source, and your package manager system takes care of how to configure and compile these.

That said, commercial software, which should be distributed without disclosing the actual source code, is usually (cross-)compiled by the vendor for various linux distributions.

like image 165
πάντα ῥεῖ Avatar answered Oct 12 '22 22:10

πάντα ῥεῖ