boostorg / date_time

Boost.org date_time module
http://boost.org/libs/date_time
Boost Software License 1.0
67 stars 95 forks source link

Since the library is header-only, it shouldn't autolink #189

Closed pdimov closed 3 years ago

pdimov commented 3 years ago

This part https://github.com/boostorg/date_time/blob/develop/include/boost/date_time/compiler_config.hpp#L126-L145 probably needs to be removed now, because including a header causes LNK1104: cannot open file ‘libboost_date_time-vc142-mt-x64-1_76.lib’ and this should no longer be necessary.

JeffGarland commented 3 years ago

Yeah, you're right -- although the error is odd since the library is still built -- I believe at your suggestion for backward compatibility....

pdimov commented 3 years ago

Yes, the library is still built if you build Boost, but not if you don't. :-) (ASIO f.ex. is header-only, but includes DateTime headers.)

JeffGarland commented 3 years ago

Good point. Will remove...soon...

JeffGarland commented 3 years ago

@pdimov do you think the dyn_link can be removed to -- or is there some dependence elsewhere?

// we need to import/export our code only if the user has specifically
// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
// libraries to be dynamically linked, or BOOST_DATE_TIME_DYN_LINK
// if they want just this one to be dynamically liked:
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_DATE_TIME_DYN_LINK)
    // export if this is our own source, otherwise import:
#   ifdef BOOST_DATE_TIME_SOURCE
#     define BOOST_DATE_TIME_DECL BOOST_SYMBOL_EXPORT
#   else
#     define BOOST_DATE_TIME_DECL BOOST_SYMBOL_IMPORT
#   endif  // BOOST_DATE_TIME_SOURCE
#endif  // DYN_LINK
pdimov commented 3 years ago

I wouldn't touch that part. If you don't have any exports the Windows linker doesn't generate a .lib file.