What is a header-only library

I am working on using boost C ++ libraries for my next project and the documentation says it is a header-only library.

Most Boost libraries are for headers only: they are composed entirely of header files containing templates and inline functions, and do not require separately compiled library binaries or special handling when stitching.

So my question is, does this mean that I don't need to link a library for these acceleration libraries, and including the header is the only requirement?

what are just header libraries and how are they different from standard libraries that require building and linking to binary?

+3


source to share


1 answer


A title-only library, like name hints, consists of titles only. This actually means that you do not need to link to binaries, because all the code for this library is contained in the headers, and this code will be compiled when you include them in your project.



Such libraries are sometimes the only way, for example when working with templates.

+7


source







All Articles