From mbruckner94 at gmail.com Tue Jun 15 06:17:17 2021 From: mbruckner94 at gmail.com (Marcel Bruckner) Date: Tue Jun 15 09:12:15 2021 Subject: [xsd-users] Invalid use of incomplete type error for C++ data bindings for OpenDrive 1.6.1 generated with xsdcxx cxx-tree Message-ID: Dear CodeSynthesis Team, I have downloaded and extracted the OpenDrive V1.6.1 standard ( https://www.asam.net/standards/detail/opendrive/) that provides multiple xsd files (The xsd schema is attached to recreate the situation). I have generated data bindings using: *xsdcxx cxx-tree --std c++11 \ --reserved-name access=parkingSpace_access \ --reserved-name link=lane_link \ --reserved-name signal=signals_signal \ --reserved-name container=road_container \ --generate-serialization --generate-polymorphic \ --root-element-all \ *.xsd* When I compile the resulting .hxx and .cxx files using: *c++ -I.../libxsd -c *.cxx* I get the following error: *opendrive_16_junction.hxx:644:74: error: invalid use of incomplete type ?class simulation::standard::opendrive_schema::_OpenDriveElement? 644 | class t_junction: public ::simulation::standard::opendrive_schema::_OpenDriveElement* And the following warning: *opendrive_16_core.hxx:274:13: note: forward declaration of ?class simulation::standard::opendrive_schema::_OpenDriveElement? 274 | class _OpenDriveElement;* The error and warning is repeated for every occurence of *_OpenDriveElement* in all files. It happens on: - Ubuntu 20.04.2 LTS - CodeSynthesis XSD XML Schema to C++ compiler 4.0.0 - c++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 - zsh 5.8 (x86_64-ubuntu-linux-gnu) / GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu) This prevents me from compiling the generated .hxx and .cxx files and I cannot use them to parse some maps I need for research. Best regards, Marcel Bruckner -------------- next part -------------- A non-text attachment was scrubbed... Name: xsd_schema.tar.xz Type: application/x-xz Size: 17808 bytes Desc: not available Url : https://codesynthesis.com/pipermail/xsd-users/attachments/20210615/a3fbd7e2/xsd_schema.tar.bin From boris at codesynthesis.com Wed Jun 16 07:38:47 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jun 16 07:38:04 2021 Subject: [xsd-users] Invalid use of incomplete type error for C++ data bindings for OpenDrive 1.6.1 generated with xsdcxx cxx-tree In-Reply-To: References: Message-ID: Marcel Bruckner writes: > opendrive_16_junction.hxx:644:74: error: invalid use of incomplete type > ?class simulation::standard::opendrive_schema::_OpenDriveElement? 644 | > class t_junction: public > ::simulation::standard::opendrive_schema::_OpenDriveElement This most likely means that the schema has cycles that involve inheritance and as a result can only be compiled in the --file-per-type mode. For background/details, see: http://www.codesynthesis.com/~boris/blog/2008/02/13/codesynthesis-xsd-3-1-0-released/ From mdorier at anl.gov Tue Jun 22 12:37:03 2021 From: mdorier at anl.gov (Dorier, Matthieu) Date: Tue Jun 22 12:59:00 2021 Subject: [xsd-users] XSD fails to build with gcc 10.3.0 Message-ID: <6E15B96A-B600-4C1C-AE2D-0A53D8ED4CBE@anl.gov> Hi, I was trying to build XSD on my Ubuntu machine with gcc 10.3.0 and it eventually fails with the following error: /projects/xsd-4.0.0+dep/libxsd-frontend/xsd-frontend/semantic-graph/elements.cxx: In function ?std::wostream& operator<<(std::wostream&, const Path&)?: /projects/xsd-4.0.0+dep/libxsd-frontend/xsd-frontend/semantic-graph/elements.cxx:298:13: error: no match for ?operator<?} and ?cutl::fs::basic_path::string_type? {aka ?std::__cxx11::basic_string?}) 298 | return os << path.string (); | ~~ ^~ ~~~~~~~~~~~~~~ | | | | | cutl::fs::basic_path::string_type {aka std::__cxx11::basic_string} | std::wostream {aka std::basic_ostream} It seems to build fine on another machine with gcc 9.3.0. Thanks, Matthieu From boris at codesynthesis.com Wed Jun 23 09:44:57 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jun 23 09:44:08 2021 Subject: [xsd-users] XSD fails to build with gcc 10.3.0 In-Reply-To: <6E15B96A-B600-4C1C-AE2D-0A53D8ED4CBE@anl.gov> References: <6E15B96A-B600-4C1C-AE2D-0A53D8ED4CBE@anl.gov> Message-ID: Dorier, Matthieu writes: > I was trying to build XSD on my Ubuntu machine with gcc 10.3.0 and it > eventually fails with the following error: > > /projects/xsd-4.0.0+dep/libxsd-frontend/xsd-frontend/semantic-graph/elements.cxx: In function ?std::wostream& operator<<(std::wostream&, const Path&)?: > /projects/xsd-4.0.0+dep/libxsd-frontend/xsd-frontend/semantic-graph/elements.cxx:298:13: error: no match for ?operator<?} and ?cutl::fs::basic_path::string_type? {aka ?std::__cxx11::basic_string?}) > 298 | return os << path.string (); > | ~~ ^~ ~~~~~~~~~~~~~~ > | | | > | | cutl::fs::basic_path::string_type {aka std::__cxx11::basic_string} > | std::wostream {aka std::basic_ostream} > > It seems to build fine on another machine with gcc 9.3.0. I believe this is the fix for this issue: https://git.codesynthesis.com/cgit/libxsd-frontend/libxsd-frontend/commit/?id=5029f8665190879285787a9dcdaf5f997cadd2e2 The easiest is probably to apply this (trivial) patch to the version you are already using. Alternatively (and if you are feeling adventurous) I can give you instructions on building the latest master with build2.