Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Distributing with Boost Library?

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?

like image 204
iQ. Avatar asked Sep 11 '09 16:09

iQ.


People also ask

What is the use of Boost library?

Boost is a set of libraries for the C++ programming language that provides support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. It contains 164 individual libraries (as of version 1.76).

Is Boost library still useful?

After 20 years of active Boost development, it's now recognized as a very powerful C++ library, for each major version many C++ libraries from the community were added. The Boost reviewers have an advanced C++ skills and their contributions guarantee a high quality for many years.

How do I contribute to Boost library?

To participate in development, you need to subscribe to the Boost developers' list. Once you've done that, some paths to contribution are: Submit patches for new features or bug fixes. Pick any ticket from our bug tracking system on GitHub and get started.

Is Boost library fast?

boost and the C++ standard libraries are used to produce extremely fast production implementations.


1 Answers

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
like image 149
ebo Avatar answered Oct 21 '22 07:10

ebo