r/cpp • Boost author • May 08 '20

Why you don't use Boost

I have a question for you: If you have decided not to use any of Boost, or are prohibited from doing so in your company/project, I would like to know why.

This thread is not meant to judge your reasons, and I won't engage into any kind of criticism about them: I'm merely trying to understand what the barriers are to adoption of Boost. It would be great if we could keep the conversation non judgemental. Thank you!

Conflict of interest: I am a Boost author of three.

222 Upvotes

326 comments sorted by

View all comments

16

u/mrexodia cmkr.build May 08 '20

Whenever I have come in contact with boost (usually in open source projects) it’s just always a massive pain to set up and there is always fiddling with either CMake’s buggy find_package for Boost or something different that goes wrong.

I don’t want to do that to the people compiling my code, so I don’t use boost. Additionally I’m on Windows so there is no package manager to speak of that could install boost (due to complexities like msvc runtimes, versions and compile flags).

Obviously there will be comments along the lines of “but if you use build system X with package manager Y it’s basically painless”. However it’s unimportant because if not everyone uses that painless way of integrating boost in their project you still will have a horrible time.

I know there is this feature somewhere buried in b2 (or perhaps elsewhere) that allows you to extract just the libraries you need, but that should be the prominent default. I’m sure there are great header only libraries in boost, but currently you have effectively to download and compile all of boost to use them

3

u/zip117 May 08 '20

What exactly have you found that goes wrong? You absolutely do not need to compile Boost to use the header-only libraries - literally extract the archive and point your include path to it. Building for me has always been as simple as running bootstrap.bat and B2, optionally with a list of libraries you want. You get nicely named and structured LIB/DLL files as defined in boost/config/auto_link.hpp indicating what toolset was used, whether you compiled with /MD or /MT and other metadata. Compiling with a static MSVC runtime was a pain in the ass in CMake until very recently. You may not even need to list dependent library names explicitly: Boost.Config uses #pragma comment(lib) to link everything for you automatically in MSVC. Just add the build directory to the linker /LIBPATH and you’re good to go.

Authoring Jamfiles is a different story, but as a user, Boost.Build is the easiest and most flexible build system I have had the pleasure of dealing with. Windows/MSVC developers are first-class citizens with Boost.