[xsd-users] Compiling to multiple DLLs, duplicate symbols problem

Boris Kolpackov boris at codesynthesis.com
Thu Feb 18 15:20:48 EST 2010


Hi Greg,

Greg Carter <greg at permedia.ca> writes:

> I think the problem is with generated code like:
>
> namespace xml_schema
> {
>    template class GEOCOSMXMLBASE_SYMBOL_DECL  
> ::xsd::cxx::tree::simple_type< type >;
> }
>
> This seems to be in violation of C++ standard (section 14.7.3 para 2).

Yes, this is a Microsoft-specific extension (which may or may not work
with the symbol visibility feature in GCC). I was too quick to say that
the same generated code can be used across all the platforms; there are
currently some options (such as --export-xml-schema) that result in
platform-specific code. I will think of a way to work around this 
(probably wrap it in #ifndef NO_EXPORT_XML_SCHEMA so that the code 
can be used on other platforms with just a simple define).

> I think this is related to the --export-maps/--import-maps option.  Do  
> you see any way around this?

I think this particular case is caused by --export-xml-schema but these
two options are also MS (and starting from 3.3.0, GCC) -specific.


> If I remove the --export-maps/--import-maps options and regenerate 
> my code for a Linux build, will I still be able to separate the 
> generated code into multiple shared libs (Linux)?

Yes, sure. On Linux everything will work out of the box without any
extra effort from your side.

Boris



More information about the xsd-users mailing list