[xsd-users] Re: XSD 2.3.1 export symbols problem with MSVC 8.0

Shaun Mangelsdorf s.mangelsdorf at gmail.com
Tue Oct 23 07:16:42 EDT 2007


Hi again xsd-users,

Just following up what I wrote earlier, I have made some progress on getting
my code to compile.


c:\xsd\libxsd\xsd\cxx\tree\buffer.txx(97) : error C2064: term does not
> evaluate to a function taking 2 arguments


After taking a look at this file, I changed the line from:
          capacity_ (other.capacity_, false);
to:
          capacity (other.capacity_, false);
and this compilation error went away.

I then checked XSD 3.0.0 and noticed that this is already changed in this
version, so perhaps this is a known and fixed bug :)


c:\xsd\libxsd\xsd\cxx\tree\containers.hxx(932) : error C2248:
> 'xsd::cxx::tree::uri<C,B>::uri' : cannot access protected member


Perhaps an obvious fix here, I changed the visibility on the default
constructor for xsd::cxx::tree::uri ( types.hxx:1187) to public. Got rid of
the error message but this still leads me to think there is a problem with
the way this is being used.

What I have discovered is that (as an example) for the SAML2 <Audience>
element, the following typedefs are created:
      public:
      struct Audience
      {
        typedef ::xml_schema::uri type;
        typedef ::xsd::cxx::tree::traits< type, wchar_t > traits;
        typedef ::xsd::cxx::tree::sequence< type > container;
        typedef container::iterator iterator;
        typedef container::const_iterator const_iterator;
      };

My xml_schema file, generated in the first step of my commands that I
pasted, has the following typedef for uri:
typedef ::xsd::cxx::tree::uri< wchar_t, simple_type > uri;


So what I'm seeing here is that the "container" typedef is effectively:
xsd::cxx::tree::sequence< xsd::cxx::tree::uri<wchar_t, simple_type> >

When that is instantiated (I can't find a direct reference here, but this is
what the compiler is complaining about) the following constructor is
referenced:
        explicit
        sequence (size_type n)
            : sequence_common (n, X ())
        {
        }
with X=xsd::cxx::tree::uri<wchar_t, simple_type>

I believe this is where it chokes, since X() is not visible. My theory is
that G++ doesn't see it because it's never used, and so it's not compiled,
but MSVC compiles the whole template class. This is just a theory however. I
can't see a way to resolve this without modifying the libxsd code to expose
the uri() constructor publicly. Any thoughts or ideas?


Thanks,
Shaun Mangelsdorf



More information about the xsd-users mailing list