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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.