How do you properly use dynamic linking with Boost on Windows?

If I dynamically link against Boost libraries, I still have to copy the respective Boost DLLs into the folder of the executable for the program to work.

I installed Boost into the recommended path C:\local\boost_1_59_0

Also, taking redistribution into consideration, probably very few people will have Boost installed, and there isn't really a user-friendly redistributable package, like with the Visual C++ libraries.

So does it make more sense to just statically link Boost in order to save some time? I don't really see the benefit of dynamic linking for Boost (on Windows that is!).

Thank you for your tips.

Upvotes: 0

Views: 85

Answers (1)

Anmol Singh Jaggi
Anmol Singh Jaggi

Reputation: 8576

You are correct in saying that you'll have to distribute the dynamic library too, since not many people will be having it. But a dynamic library is not made just for this purpose only.
It can be useful in case multiple applications have to use that library simultaneously.

For example, if your client has multiple applications using the boost dynamic libraries, it makes sense to just send the dynamic library once, and install it into a commonly accessible location and let all those applications use it. This way, the individual sizes of those applications will remain small.

Another use case could be your client simultaneously running multiple instances of a single executable which requires the library.

Upvotes: 1

Related Questions