So I have two projects, A and B, where B is dependent on A (A is a library, while B is a console application). A uses the boost library, and has been configured to include the header and library files, but B has not.
Visual studio throws an error saying the Boost Header files cannot be found (in project B). For example:
error C1083: Cannot open include file: ‘boost/asio.hpp’: No Such file or directory [Project: B]
My question is: Is there a way such that B does not have to include the Boost library as well?
Yes, but only if you can avoid using the features as part of A’s type/function definitions. If they can be used truly implementation-only, then you can avoid the header dependency — you’ll still need to link against compiled libraries (
asiorequiresboost-system).