Using specific libraries of Boost

Started by
5 comments, last by Mybowlcut 12 years, 10 months ago
How can I use only certain Boost libraries in my project? I only want to use a few libraries and not use the rest, but am not sure if they have dependencies on each other. I've got Boost.Build set up, but am kinda unsure of what to do next...

Advertisement
I just made a folder structure emulating the boost structure and included boost/filesystem.hpp. I kept on copying across the files it couldn't find (when building) into the new folder structure and it seems to be working besides not being able to find the libboost_filesystem-vc80-mt-gd-1_46_1.lib file. Is this a good way to use only certain parts of Boost? How do I use boost.build to build the filesystem libaries for example? I am reading Jamroot in the Boost root folder and it seems like --with-<library> would do it (as an argument when building with bjam)?

Answered my own question. :) Works perfectly!


I just made a folder structure emulating the boost structure and included boost/filesystem.hpp. I kept on copying across the files it couldn't find (when building) into the new folder

Why couldn't you use the headers in the original boost directory? Just include the headers you need, and it shouldn't include the rest. And (IIRC) most of boost is just headers. Only a few of the libraries need to be built. If you don't need those libraries, you don't have to build them ;)

[quote name='Mybowlcut' timestamp='1306633311' post='4816958']
I just made a folder structure emulating the boost structure and included boost/filesystem.hpp. I kept on copying across the files it couldn't find (when building) into the new folder

Why couldn't you use the headers in the original boost directory? Just include the headers you need, and it shouldn't include the rest. And (IIRC) most of boost is just headers. Only a few of the libraries need to be built. If you don't need those libraries, you don't have to build them ;)
[/quote]
Because this is for a project that is hosted on a repository, with many users. I only want to include the header files that are absolutely necessary, instead of the whole boost folder.

I'm using filesystem and date_time, which apparently require system as well.

There's a tool for this, BCP. I've never used it, so I don't know how well it works, though...

There's a tool for this, BCP. I've never used it, so I don't know how well it works, though...

Ah, that looks like a great tool. Thanks.

This topic is closed to new replies.

Advertisement