Opened 20 years ago

Last modified 18 years ago

#52 closed defect

Proper dynamic linking on Windows — at Initial Version

Reported by: ghost Owned by: somebody
Priority: major Milestone: C++ Boost maintenance
Component: component1 Version:
Keywords: Cc:

Description

Need decide how BOOST_ALL_DYN_LINK or BOOST_ALL_SOMELIB_LINK should be set when linking to a library using V2.

Issues:

  1. If we're using V2 to link to a library, we don't need auto-linking, that's just extra work for the linker as we're linking to the library on the command line.
  2. Without BOOST_ALL_DYN_LINK, Boost library headers won't contain necessary declexport declaration, so linking to DLL won't work.
  3. It's easy to forget BOOST_ALL_DYN_LINK in client code.

I think the right solution would be for every library to have two extra elements in usage requirements:

  • <link>shared:<define>BOOST_SOMELIB_PLEASE_USE_DECLSPEC_IN_HEADERS
  • <link>shared:<define>BOOST_SUPPRESSAUTOLINK

BOOST_ALL_DYN_LINK

  1. Don't set them at all, since they cause autolink which is not necessary if

we're linking to a library using V2 -- the library will be found anyway.

  1. But with (2), the dllexport won't be used, so we need so set some macro to

Change History (0)

Note: See TracTickets for help on using tickets.