13

For any C++ Boost library, how can one find out which Boost library(ies) it requires ?

Example (not necessary a working example though): Boost library "test" requires Boost library "date_time".

Regards,

David Andreoletti
  • 3,990
  • 3
  • 28
  • 49

3 Answers3

12

boost comes with a tool to gather the dependencies of a library.

It is called bcp. If you just want a list of files, you have to use the --list option.

mirk
  • 4,982
  • 3
  • 30
  • 47
  • It has happened to me as well. Especially, with questions with short answers, like these. – mirk May 30 '12 at 15:12
6

If you want to find out those dependencies to isolate the components your software requires, you can use bcp (Boost Copy)

It copies selected boost libraries and all its dependencies to a target location.

Eg

bcp regex /foo

copies the complete regex library and its dependencies to /foo

Disclaimer: I do not have any practical experience with bcp.

EDIT: If you only want to check on which compiled library a compiled library depends, you can either use ldd <boost_library_filename>.so on Linux or Dependency Walker on Windows.

Johannes S.
  • 4,348
  • 23
  • 41
2

A modern solution is to use boost Dependency Report (available starting from boost v1.66.0).

user7860670
  • 33,577
  • 4
  • 51
  • 80