[xsd-users] Compiler errors occurred in the generated *.hxx files from CodeSynthesis 3.2

William Canton stargate625 at gmail.com
Mon Mar 28 11:43:19 EDT 2011


I am not sure what was causing the following compiler errors in the
generated header file:

1>c:\test\generated\codf.hxx(391) : error C2146: syntax error : missing ';'
before identifier 'FileSystem_type'
1>c:\test\generated\codf.hxx(391) : error C2838: 'FileSystemType' : illegal
qualified name in member declaration
1>c:\test\generated\codf.hxx(391) : error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
1>c:\test\generated\codf.hxx(392) : error C2065: 'FileSystem_type' :
undeclared identifier
1>c:\test\generated\codf.hxx(393) : error C2065: 'FileSystem_type' :
undeclared identifier
1>c:\test\codf.hxx(402) : error C4430: missing type specifier - int assumed.
Note: C++ does not support default-int
1>c:\test\codf.hxx(402) : error C2143: syntax error : missing ',' before '&'
1>c:\test\generated\codf.hxx(408) : error C2065: 'FileSystem_type' :
undeclared identifier
1>c:\test\generated\codf.hxx(532) : error C2079: 'CarouselType::FileSystem_'
uses undefined class 'xsd::cxx::tree::optional'
1>c:\test\generated\codf.hxx(6546) : error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
1>c:\test\generated\codf.hxx(6546) : error C2143: syntax error : missing ','
before '&'
1>MyApp.cpp

The codf.hxx was generated by the CodeSynthesis after compiling the XML
Schema file codf.xsd.  But when I included this header file in my MyApp.cpp
file, the build failed with various mysterious syntax errors while
processing the codf.hxx header.  When I opened the codf.hxx file, it has a
snippet of content as follows surrounding the location of the reported
errors:

386  void
387  OCConfiguration (const OCConfiguration_sequence& s);
388
389  // FileSystem
390  //
391  typedef ::FileSystemType FileSystem_type;
392  typedef ::xsd::cxx::tree::optional< FileSystem_type >
FileSystem_optional;
393  typedef ::xsd::cxx::tree::traits< FileSystem_type, char >
FileSystem_traits;

It's unclear to me why my Visual Studio C++ 2008 reported an error on line
number 391.  The was the first build error detected.  Before this line,
there is a function on line 387 returning a "void" type.  This could have
caused the error.  It seemed like the compiler somehow could not even
recognize the keyword "void."

Any idea what could have caused these strange compiler's behavior?

William


More information about the xsd-users mailing list