I am developing an Open Source library and would have a headers-only library as dependency for it. This dependency will only be used in a single cpp file and thus not exposed via our libraries' headers.
Considering the following setup of an application:
OurLib/
- includes <headerOnlyLib.h>, but does not expose this via headers (cpp only)
Application/
- links to OurLib (either statically or dynamically)
- includes <headerOnlyLib.h>
What problems can occur due to this setup? What if the application and the library use a different version of the headers-only library? Can there be conflicts? Will there be noticable code duplication?
And finally: Would there be an advantage in this context, if the headerOnlyLib instead was a dynamically or statically linked library?