Which of boost library includes boost spirit? - boost

Oh well, I can't find this easily. Could you let me know which of boost library includes boost spirit? Is it system or iostream?

Google for 'boost spirit site:boost.org' and you get right to the Boost Spirit page. Boost is a collection of libraries, this is one such library. You may want to read the introductory documents to learn about download and installation; several Linux distributions would include it premade.

Related

how to use boost libraries in mingw which are built with msvc

I built boost libraries with msvc. And I want to link to my program using mingw. As the title asked, how can I achieve that?
When I try to link the boost libraries. The compiler suggests that it can't find symbols of the boost libraries.
Quoting the mingw wiki here:
Object files and static libraries created with different compilers [...] often cannot be linked together. This issue is not specific to MinGW: many other compilers are mutually incompatible. Build everything from source with the same version of the same compiler if you can.
It is stated in the same page that if you want, you may use dynamic (shared) libraries from different compilers if you provide a C interface for the library you want to use. Then your program would use this interface (C wrapper library) to communicate with Boost, by including the header for this interface library with extern "C". Example of doing this can be found here.
In your case, however, this would not be preferable as you would have to expose everything you want to use from Boost one by one in the C interface that you would write yourself. You might find it much easier just compiling your libraries with the same compiler you are compiling your program with.

Which Boost package do I need for bpstl::allocator?

I have inherited some code which uses bpstl::allocator. Obviously, my predecessor had certain Boost libraries installed and I do not.
Which (Linux) package do I need to install in order for the code to compile?
I can't find a DoxyGen or other navigable Boost documentation online.
Likely, bpstl is just a namespace alias. If I were to guess, I'd say
boost pool
boost container
boost interprocess
There's not a wellknown library that uses bpstl as a namespace (not even obsolete, that I remember) so, in all likelihood, such aliases can be found in the adjacent code base (headers) next to that code you inherited. It's gonna take some archaeology, but grep your way to it!
On debian-like Linuxen, by far the easiest way to get some mainstream version of boost installed is by
sudo apt-get install libboost-all-dev
Boost "navigable" documentation online is here: http://www.boost.org/doc/libs/1_57_0

Boost (.asio) linking

So I followed this, all the way to the "Include Boost headers and link with Boost libraries" section.
For asio, what do I #include (besides asio.hpp, of course)and what libraries do I link?
In fact, is there a big list somewhere of all the boost libraries, and what you need to include to get them to work?
That would be very useful.
I am talking by heart.but.for using boost.asio in windows I remember you needed to define WINNT 0X501 or similar and link against boost.system and the win32 sockets library.

Easily using Boost from within CMake without installing Boost (Boost CMake Modularization)

It seems there were/are efforts to do this, but most of the resources I've seen so far are either outdated (with dead links) or have little to no information to actually build a small working sample (that, for example relies on boost program_options to build an executable).
Also, when using ExternalProject_Add, how does one resolve dependencies inside of Boost?
I'm basically looking to use Boost easily from within CMake with little to no manual configuration.
Try Hunter package manager:
hunter_add_package(Boost COMPONENTS regex system filesystem)
find_package(Boost CONFIG REQUIRED regex system filesystem)
target_link_libraries(foo PUBLIC Boost::regex Boost::system Boost::filesystem)
Note that usage of imported Boost targets is importand for relocatable packages
Wiki
Boost package
Relocation notes
Examples
Small
Big
Currently (August 2017) Boost libraries do not provide CMake support nor are they build using CMake. Boost has its own build system called b2. In July 2017 the Boost steering committee announced that all boost libraries should be moved to use CMake. This affects users and developers, i.e., CMake will be used internally to build the libraries and externally it will provide CMake config files.
As the build system question triggered heated discussions in the past years and there are strong feeling from part of the community against b2 and CMake, the outcome of this decision is unclear (first release with CMake, will all old libraries support CMake, even a split of the Boost community).
Original Answer from 2015
You can consider the effort to introduce CMake as a first-class citizen to boost as dead. See the mailing list thread about the topic.
If you don't want to use third party tools like hunter's package manager, check the most current verion of the boost library you want to use. Maybe you are lucky and it provides some CMakeLists.txt files you can use.
The most recent work on 'a boost which uses CMake and makes boost use ideal for CMake users' is here:
https://github.com/boost-cmake/boost-cmake
It requires cmake master branch (until CMake 3.0.0 is released soon) and I haven't attempted to build it in a while. Someone in the boost community would have to push forward with transitioning boost to CMake. The boost community might still be busy with transitioning to git.

Do I have to recompile boost library if I modify `boost\format\alt_sstream_impl.hpp`

I need to modify the following file in boost library
c:\boost\vs2010_boost1.49\include\boost\format\alt_sstream_impl.hpp
Based on doc
The only Boost libraries that must be built separately are:
Boost.Filesystem
Boost.IOStreams
Boost.ProgramOptions
Boost.Python (see the Boost.Python build documentation before building and installing it)
Boost.Regex
Boost.Serialization
Boost.Signals
Boost.Thread
Boost.Wave
Question> Is alt_sstream_impl.hpp one of them?
It appears to me (looking at the 1.49 release) that 'alt_sstream_impl.hpp' is part of the Boost.Format library, and therefore, you will not need to rebuild your boost libraries.
It is possible (but not that likely) that one of those libraries that has to be rebuilt uses Boost.Format, but I didn't see any evidence of it.

Resources