[xsd-users] Double definitions when using DLLs

Boris Kolpackov boris at codesynthesis.com
Mon May 12 23:35:12 EDT 2014


Hi Alexander,

alexander.gosling at kongsberg.com <alexander.gosling at kongsberg.com> writes:

> Are there any plans to fix this more permanently?

This is really a problem in the MS toolchain. Essentially, with VC++ it
is impossible to derive from std::string if DLLs are used.

Unfortunately there is no easy way to work around this problem from
our side. The "permanent" way to fix this would be to stop deriving
from std::string. But that would also remove fairly useful
functionality: right now one can pass xml_schema::string (or any
other string-based type) to an interface that expects std::string
and everything will work out of the box. Removing this functionality
for everyone just because Microsoft's toolchain is broken seems like
a bad idea.

Note also that it is already possible to customize the xs:string type
and provide your own implementation without inheritance. Maybe providing
a custom implementation like this and instructions that describe how to
set everything up would be sufficient?

Boris



More information about the xsd-users mailing list