If I compile a C++ program on a linux box that has many libraries installed (Boost for example) and then copy that executable to a new linux box without those libraries, will the executable still run properly?
This depends a lot on the specific libraries. There are three kinds of libraries out there:
Most Boost libraries are header-only: they require no separately-compiled library binaries or special treatment when linking. Other libraries are static, i.e. they are needed only at build time for linking. The only libraries that must be available on the target machine are dynamic (shared) libraries; if you have no dynamic library dependencies, copying an executable and setting the appropriate permissions will work fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With