[xsd-users] gcc visibility, serializer-map and typeinfo
    Boris Kolpackov 
    boris at codesynthesis.com
       
    Fri Jun 25 11:41:39 EDT 2010
    
    
  
Hi Benjamin,
Benjamin Schindler <bschindler at inf.ethz.ch> writes:
 
> If I have a template class like this:
> 
> template<typename T>
> class Bla {
> // some code
> };
> 
> and I instantiate this template in different dso's, the template will be
> instantiated in each dso with visibility=hidden and they therefore get
> their own type_info object. This problem does not occur with the stl as
> they declare their namespaces like this:
> 
> _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) which expands to
> 
> namespace std __attribute__ ((__visibility__ ("default"))) {
> 
> This means, that the template type gets exported and the type_info
> object get correctly merged. 
Interesting.
> I'll let it up to you to decide what and how you would like to export 
> your stuff. as little as possible is always a good thing, but since 
> libxsd is template only, it might make sense to export the entire 
> namespace may be
Actually, there is way to export the individual template instantiations
that make up the xml_schema namespace. See the description for the
--export-xml-schema option. Your util.dll looks like a good place
to do this.
Boris
    
    
More information about the xsd-users
mailing list