Question

Out of intellectual curiosity, I was wondering why the boost::filesystem library had a compiled component, while in other cases no compiled components are necessary. What is in the compiled portion that can not be in a hpp?

What really confuses me is that on my computer I compile this portion anyway (before using the library), and I would thus expect it to be possible or even preferred to perform the same compilation I did in BJam every time I build my application.

Why is there the additional .so/.a file?

Was it helpful?

Solution

Some boost libraries are header-only and some other need to be built (system, filesystem, graph, mpi, serialization, etc); several boost libraries can be configured to be either header-only or separately built.

The advantages of separately built libs are quite obvious: your own project compiles faster and depends on less external code.

By the way, take a look at the following thread: http://boost.2283326.n4.nabble.com/Lighweight-header-only-version-of-Boost-Filesystem-tt3749876.html#none

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top