[xsd-users] Issue with using xsd generated code in DLLs with Visual Studio 2010

Boris Kolpackov boris at codesynthesis.com
Tue Sep 21 10:07:12 EDT 2010


Hi Timo,

Timo Geusch <timo.geusch at styleadvisor.com> writes:

> I've just tried this with a subset of the DLLs in the project. 
> Unfortunately the suggested workaround still results in the same
> problem - the "root" DLL still exports symbols that are part of
> the std namespace - say, std::basic_string<char>::front() that
> subsequently clashes with the same symbol in one of the 'leaf'
> DLLs

Are the clashing symbols in the leaf DLL also exported?

My understanding of how all this can work is as follows:

1. In the root DLL the XML Schema types are exported which
   triggers instantiation and exporting of types that they
   derive from, e.g., std::basic_string<char>.

2. The leaf DLL includes the XML Schema types from the root
   DLL but now they are imported. The base classes are
   imported as well so the leaf DLL uses them from the root
   DLL instead of instantiating its own.

The only tricky part here is that this may rely on the XML Schema
types being included into every C++ file in the leaf DLL. If
there is a C++ file that doesn't know anything about XML Schema
types (and as a result, that std::basic_string is imported),
then it can instantiate the class which can lead to the symbol
clash.

However, even in this case, I think (though not 100% sure) that
there shouldn't be a clash since those symbols are not exported.
They are for leaf's DLL private use. I would expect two template-
based symbols to clash only if both symbols are exported.

So what would be good to understand is whether the symbols from
the leaf DLL that clash are exported and where do they come from.

> because in the default build settings, the affected C++ classes
> are header-only.

Which classes are referring to? I am not sure I follow you here.

Boris



More information about the xsd-users mailing list