vshah
vshah

Reputation: 1

Can not open boost header from my static lib C++ VS

I have created test C++ static library in VS and I am using boost in that.

Now this static lib is used/linked in DLL I have created. Now I want to link this DLL in a c++ console application.

Static lib and DLL both compiles fine. When I am using this dll in console application, I am getting error in static lib's header file that can not open include file #include "boost/config.hpp"

I copied static lib's header and dll's headers in console application and linked through properties/linker/additional library directores

I really dont want any user who are using my dll to link with boost and all. I just want to supply dll and they should be good to use it.

Please guide me. I am dealing with DLL and static lib. for the first time.

So If I include all boost headers in my application, it should be good to use. Is there any other solution?

Upvotes: 0

Views: 80

Answers (2)

Lightness Races in Orbit
Lightness Races in Orbit

Reputation: 385098

I really dont want any user who are using my dll to link with boost and all. I just want to supply dll and they should be good to use it.

That's pretty much tough, not least because most of Boost is header-only.

Upvotes: 0

Jon Trauntvein
Jon Trauntvein

Reputation: 4554

The header files from your static library are including boost. When you include these in your application, the compiler is looking for the boost includes as well. If the boost declarations are not a part of your library interface, then these includes need to be moved out of header files referenced by your application.

Upvotes: 1

Related Questions