views:

311

answers:

1

Hey guys, i'm quite new to using boost and I can't seem to find documentation anywhere on how to distribute your application when using boost?

Many of the libraries are shared libraries, i'm not expecting my users to have boost installed, i'm only using a single library (regex) so is there an easy way to package the regex library with my application without compiling with the static version?

Thanks for the help

+5  A: 

Linux

For binary distribution, I recommend using the distribution's package management, which should take care of any dependencies. Some commercial apps just use binary blobs and you need to install a version of boost by yourself.

Finding libraries is a bit more difficult on linux. It does not automatically load shared objects from the current directory if they are linked at compile time (as opposed to loading at runtime with dlopen).

You have to use the LD_LIBRARY_PATH env variable or use rpath. Both has it's drawbacks.

Windows

There is no way around including the dlls. The usual approach is to put everything into a directory and zip it up.

Both

To build from source you need the boost sources anyway, so no need to include libraries.

Most libraries in boost are header only anyway, regexp is not one of them. It should be sufficient to include dlls for this module. In Linux you can check against which shared libs your binary is compiled by using:

ldd binary
ebo
Yeah I was intending to just provide the .so and .dll files for pre-built applications seperate from source. So your saying it will work just by taking the the compiled lib files? With the regex I know like u said its not a header only file, so I will provide the built regex library with the source as well
iQ
Compiled lib files? Users need all linked shared libraries. For Linux you should rely on the package management.
ebo
sorry i meant providing the pre-built regex library instead of relying on the user to have it built. With the source code version I don't have to worry, i'll let the user take responsibility to get the appropriate libraries should they want to build it.If all works just by providing the .so or .dll files then its good. I heard boost had a tool where it can extract and find all libraries your app is using, anyone know?
iQ
So what do you want know? It is possible to provide .so files. Is it good style? Probably not, you should use package management for libs.
ebo
well what if i said what i'm creating is a shared library? So i'm trying to find a way to distribute my library that also uses a bit of another library... lol. I'm a bit lost on how to distribute it with these dependencies
iQ