Howdi folks. I'm currently in the process of creating a "shared" library (aka DLL on windows) which in turn would rely on "Boost C++" libraries for date time features. I have noticed that my Boost installation (done via Boostpro) has some DLL and LIB files in the lib
directory of the boost installation. OK, I thought there were required so I added them to the library dependencies in my IDE.
Now what I do is write code which uses boost date time library, create a shared library and use it from a standalone executable. It works, even though I have just copied the shared library I created into the executable folder and not the boost_date_time-vc100-mt-1_47.dll
file. Strange. Now what I do is remove the DLL/library dependency of Boost from my project and build the shared library. It still works.
I'm a bit confused. If the Boost libraries are really header only, why does my Boostpro installation have *.lib and *.dll files for datetime and other boost parts? Is there any scenario I'd want to use them given that those boost libraries anyways get compiled into my shared library?
Hope I was clear enough, please let me know if more clarifications are required. Also FWIW, I'm using Eclipse CDT + MingW for all this.
Most parts of Boost are header-only while some other parts (at least filesystem and iostreams IIRC) require to link libraries. So it all depends on which parts of Boost you use. Which parts require linking is documented on the Boost Library Documentation page.
Some libraries use automatic linking. That means the header files contain compiler-specific code to embed instructions to link in the right libraries into the object files. This is an useful feature that has to be supported by the compiler. The gcc toolchains (including MingW) don't support that though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With