I hve finally found a solution. First of all, the relevant macro symbols controlling the import/export qualifiers for Xercesc version 3.2.3 are the two symbols
DLL_EXPORT
and
XERCES_BUILDING_LIBRARY
. Depending on the state of these symbols, the symbol
PARSERS_EXPORT
is defined (together with several other symbols).
Building Xercesc as a static lib automatically configures the file
util/Xerces_autoconf_config.hpp
which then defines
DLL_EXPORT
. The symbol
XERCES_BUILDING_LIBRARY
however is not defined anywhere: it must be set externally! With both symbols defined,
PARSERS_EXPORT
will be defined as
XERCES_PLATFORM_EXPORT
, which in turn is defined as
__declspec(dllexport)
in the file
util/Xerces_autoconf_config.hpp
. Which is what we want problem solved.
For me this resolved the linker warnings LNK4286, but it triggered a number of other warnings LNK4248. This is an entirely different issue, but while it doesn't belong here, if anyone else encounters it, check out this link which explains how to resolve it:
Linker Tools Warning LNK4248 | Microsoft Docs[
^]