C++ deployment

Sep 16, 2010 at 7:59pm
Hi,

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.

How can I do it?!

Cheers.
Sep 16, 2010 at 8:14pm
Either link statically or create a package and specify these libraries as dependencies.
Sep 17, 2010 at 1:27am
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.
Sep 17, 2010 at 7:25am
You can also link dynamically and ship the required libraries with your executable
Sep 17, 2010 at 11:39am
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?!
Sep 17, 2010 at 2:12pm
Actually, my problem is that the client computer will not have internet connection. =/
Sep 17, 2010 at 11:33pm
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.
Sep 18, 2010 at 7:24am
Add -static to the gcc command (-> see the manoage)
Sep 19, 2010 at 10:05pm
PanGalactic,
Yeah, it's exactly that.

You're talking a lot about dynamic link but I really do not know how can I do it.
Do you have some tutorial please?

Thanks guys.
Sep 20, 2010 at 2:10pm
Read the manual pages on gcc first, they are very informative.
Sep 29, 2010 at 2:25pm
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?
Last edited on Sep 29, 2010 at 2:29pm
Sep 30, 2010 at 11:43am
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:
-Wl,-Bstatic -lboost_thread -lboost_system -Wl,-Bdynamic -lpthread


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.
Sep 30, 2010 at 1:59pm
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.
Topic archived. No new replies allowed.