I did an application that uses some libs like boost-thread, boost-filesystem, now I'd like to do a deployment using all that libs inside my project, because else the client can have some troubles to install it, that means, I'd like to send to client an executable and him just run it.
If the client is not very IT-literate, link those libraries static to your application so the user can run without depending on any libraries. However the size would be big and application loading time will be slightly longer. But these deficiencies should outweigh the "cost" of installation at the client end. Some client want "error-free" or what is known as "seamless and no trouble" installation.
So, if I understood, I have to create for example a folder in my project, put inside it all the libraries dependences (.o and .h) and than link this folder to my project, right?!
Is this for a Linux system where the Boost libraries are almost guaranteed to be installed? If so, just link dynamically. Otherwise, link against the static (.a) libraries.
Ok,
I did compile my program using -lboost_thread-mt -lboost_system-mt (is this dynamic link?) and works fine in my machine.
I have installed in my machine boost version 1.40 and in my client I have 1.41, when I run my software in client, throws the error: error while loading shared libraries: libboost_thread.so.1.40.0: cannot open shared object file: No such file or directory.
If I linked it dynamically, why does not work with other version?
boost releases are not compatible with each other. If there's no guarantee that the target machine will have Boost.System/Thread 1.40, you should link statically to remove the dependency.
To do that, add the following linker options:
If you check /usr/lib you'll see that there is e.g. libboost_system.so and libboost_system.a.
The .so file is the shared library and the .a archive is the static library - make sure the latter actually exists or install the appropriate package if it doesn't.
You'll go crazy with dependencies if you don't package up your software in deb and rpm format and distribute it for specific platforms. Boost libraries will be the least of your worries in short order. You've also got dependencies on the GNU C++ standard library (libcstd++), libc and others.