[xsd-users] fatal error C1046: compiler limit : struct nested too deeply

Gerard Lanois gerard at lanois.com
Tue Apr 10 11:15:42 EDT 2007


When I use --morph-anonymous, I find that the standard
idiom for parsing a document does not compile:

int _tmain(int argc, _TCHAR* argv[])
{
    std::auto_ptr<BLAH::type> blah(BLAH(argv[1]));

    return 0;
}


The above gives the following compilation errors:

c:\users\gerard\ReadBLAH\ReadBLAH.cpp(11) : error C2039: 'type' : is
not a member of 'BLAH'
        c:\users\gerard\ReadBLAH\BlahSchema.hxx(278) : see declaration of 'BLAH'
c:\users\gerard\ReadBLAH\ReadBLAH.cpp(11) : error C2065: 'type' :
undeclared identifier

It seems that --morph-anonymous prevents the usual
"public: typedef _xsd_BLAH_::BLAH type;" from being
generated in class BLAH.

What constructor & auto_ptr statement should I use to
achieve a successful parsing, equivalent to the one given
above?

Thanks for all your help,

-Gerard



On 4/6/07, Boris Kolpackov <boris at codesynthesis.com> wrote:
> Hi Gerard,
>
> Gerard Lanois <gerard at lanois.com> writes:
>
> > Anyway, is there a way to tell the xsd tool not to nest the structures as it
> > generates the .hxx/.cxx?  (to "flatten" the schema?)
>
> There is the --morph-anonymous option which names all anonymous types and
> as a result reduces nesting to the maximum of 3 levels. If this does not
> help then it would be great if you could post the part of the generated
> code (along with the surrounding code all the way to the namespace scope)
> that triggers the error.
>
>
> thanks,
> -boris
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.5 (GNU/Linux)
>
> iQGVAwUBRhYsjsiAKQuuCE8dAQKwKgv/Xb4J55BR0Bhennh+XEejIe/TV7cFijm3
> 1UxmnO7syc9Hm5R5KzUli/maj8kr1G0zJU7PwDG4Dm1WpHv+qtNOJXY8K1/xV/fj
> bPKqzYMYvZxPzDoVr7CpB0Vsrwh2dZ4P+vHy4Vxxj82U7wRmL+E/O/xwbnejPmrj
> nnoBtRWsLVHuGowV3RySdBAuCI3euiXwoCBfvwCqNP+ArLpnMBoSykxVEU+Ejqch
> 21S7vvZRtiozIgElGvZprRRgY7wl1EajwdaNRcYaONF5muybU0OX8tOrwayLWuaL
> tVWjfuPsfpRXmXgacF1nSu0cEbKFbYU4qZs0L8AejulxT+/GJLJOvEjFnP6y+/un
> xtQuIBX/GyLPcBiwjZU7cv5ZgH+h8S63382lcAdIeg/okxkdOqOxxgsLWVdS15kH
> YQYCbDaUlJmRPoWiDbM9GeNru7hUvXPX0RUkJRsHk7cGKEANc0DeCnWAjIOCBMiu
> +U8/DNslzdeztYhfBqwgGcvFTSzqtbpH
> =chS9
> -----END PGP SIGNATURE-----
>
>




More information about the xsd-users mailing list