[xsd-users] XSD generated code does not compile with g++ 4.8

Reiner Rohlfs Reiner.Rohlfs at unige.ch
Wed Feb 12 09:10:12 EST 2014


Hello,

I generate C++ code of the attached xml schema like this:

xsd cxx-tree fits_data_model_schema.xsd

and try to compile it with g++ 4.8.2:

g++ -c fits_data_model_schema.cxx

and get following error from the compiler:

In file included from /usr/local/include/xsd/cxx/zc-istream.hxx:215:0,
                 from /usr/local/include/xsd/cxx/tree/parsing/date-time.txx:7,
                 from /usr/local/include/xsd/cxx/tree/parsing.hxx:10,
                 from fits_data_model_schema.hxx:68,
                 from fits_data_model_schema.cxx:41:
/usr/local/include/xsd/cxx/zc-istream.txx: In instantiation of ‘void xsd::cxx::zc_streambuf<C>::init() [with C = char]’:
/usr/local/include/xsd/cxx/zc-istream.txx:17:13:   required from ‘xsd::cxx::zc_streambuf<C>::zc_streambuf(const xsd::cxx::ro_string<C>&) [with C = char]’
/usr/local/include/xsd/cxx/zc-istream.txx:64:20:   required from ‘xsd::cxx::zc_istream_base<C>::zc_istream_base(const xsd::cxx::ro_string<C>&) [with C = char]’
/usr/local/include/xsd/cxx/zc-istream.txx:82:45:   required from ‘xsd::cxx::zc_istream<C>::zc_istream(const xsd::cxx::ro_string<C>&) [with C = char]’
/usr/local/include/xsd/cxx/tree/parsing/unsigned-long.hxx:69:30:   required from ‘static long long unsigned int xsd::cxx::tree::traits<long long unsigned int, C, (xsd::cxx::tree::schema_type::value)0u>::create(const std::basic_string<_CharT>&, const xercesc_3_1::DOMElement*, xsd::cxx::tree::flags, xsd::cxx::tree::container*) [with C = char; xsd::cxx::tree::container = xsd::cxx::tree::_type]’
/usr/local/include/xsd/cxx/tree/parsing/unsigned-long.hxx:51:66:   required from ‘static long long unsigned int xsd::cxx::tree::traits<long long unsigned int, C, (xsd::cxx::tree::schema_type::value)0u>::create(const xercesc_3_1::DOMAttr&, xsd::cxx::tree::flags, xsd::cxx::tree::container*) [with C = char; xsd::cxx::tree::container = xsd::cxx::tree::_type]’
fits_data_model_schema.cxx:210:65:   required from here
/usr/local/include/xsd/cxx/zc-istream.txx:35:20: error: ‘setg’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
       setg (b, b, e);
                    ^
/usr/local/include/xsd/cxx/zc-istream.txx:35:20: note: declarations in dependent base ‘std::basic_streambuf<char>’ are not found by unqualified lookup
/usr/local/include/xsd/cxx/zc-istream.txx:35:20: note: use ‘this->setg’ instead

To compile the same file with g++ version 4.2.1 is working fine.

I don't know if this a compiler error or if an update of XSD is necessary.
Any help would be very much appreciated.


Bye the way, changing the line

<xs:attribute name="bin1_size"  type="xs:positiveInteger" />

to

<xs:attribute name="bin1_size"  type="xs:string" />

works fine with both versions of the compiler.

Here some information about my system:

MAC OS version 10.8.3

XSD version 3.3.0  , downloaded 09. 12. 2013

> g++ --version
g++ (GCC) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.


Thank you for your help.

Best Regards
Reiner Rohlfs








-------------- next part --------------
A non-text attachment was scrubbed...
Name: fits_data_model_schema.xsd
Type: application/octet-stream
Size: 470 bytes
Desc: fits_data_model_schema.xsd
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20140212/0a2fef11/fits_data_model_schema.obj


More information about the xsd-users mailing list