If you have written much C++, you have reached for Boost, and probably lost an afternoon to linker errors getting it installed. Here are the practical ways to add Boost to a project, with the snippets that actually work.
Header-only vs compiled
Boost is ~160 libraries in two camps. Header-only ones (asio, beast, mp11, hana, pfr) need only an #include. Compiled ones (filesystem, program_options, thread, regex, serialization, log) ship .so/.a files you must link. One gotcha: boost::system has been mostly header-only since 1.69, so you rarely need -lboost_system anymore, despite what older tutorials say.
Method 1: CMake find_package (system Boost)
Install through your package manager, then let CMake find it:










