From gfrontera at ucm.es Fri Mar 2 06:58:15 2018 From: gfrontera at ucm.es (Guillermo Frontera) Date: Fri Mar 2 08:04:21 2018 Subject: [xsd-users] Re: Missing includes in code generated from AIXM 5.1 In-Reply-To: References: Message-ID: Hi again, I found an easier way to reproduce this error. I found an entry on the Wiki that describes how to generate code for the GML 3.2.1 schemas . In the latest example that is provided in this page, named Gml-3.2.1-split-code.tar.gz , it generates code for this schemas, apparently without problem. But, if you edit the gml.options file included in the example, replacing the lines: --root-element Array --root-element Bag with the following: --root-element-all then you get the same error I'm getting. Again, manually adding the missing includes fixes the problem. Best regards, Guillermo El mi?., 21 feb. 2018 a las 18:24, Guillermo Frontera () escribi?: > Hello, > > I am generating C++ code from the AIXM 5.1 XML Schema > , but the code generated > fails to compile due to some includes that appear to be missing. I tried > using the latest stable version of CodeSynthesis XSD as well as the latest > pre-release binaries > I could find (4.1.0a11). > > The C++ code was generated by typing the following commands into a > terminal (I used Ubuntu 17.10): > > $ wget > http://aixm.aero/sites/aixm.aero/files/imce/AIXM51/aixm-5-1-20100201-xsd.zip > $ unzip aixm-5-1-20100201-xsd.zip > $ mkdir gen > $ xsd cxx-tree --std c++11 --output-dir gen --generate-polymorphic > --polymorphic-type-all --file-per-type --namespace-map > http://www.opengis.net/gml/3.2=gml xsd/ISO_19136_Schemas/gml.xsd > > Once generated, the code was compiled using a very standard CMake script > that is attached. > > Best regards, > Guillermo > From boris at codesynthesis.com Fri Mar 2 08:12:50 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Mar 2 08:15:16 2018 Subject: [xsd-users] Re: Missing includes in code generated from AIXM 5.1 In-Reply-To: References: Message-ID: Guillermo Frontera writes: > Again, manually adding the missing includes fixes the problem. Thanks for looking into this further (and sorry for not getting a chance to investigate this yet). Have you been able to identify any patter in the missing includes? I.e., do they correspond to some specific schema usage (anonymous types, global elements, etc)? Boris From gfrontera at ucm.es Fri Mar 2 09:00:17 2018 From: gfrontera at ucm.es (Guillermo Frontera) Date: Sat Mar 3 11:28:12 2018 Subject: [xsd-users] Re: Missing includes in code generated from AIXM 5.1 In-Reply-To: References: Message-ID: > > Have you been able to identify any patter in the missing includes? > I.e., do they correspond to some specific schema usage (anonymous > types, global elements, etc)? > They are global elements with a type (a named complexType) that is defined in a different .xsd file. The .xsd file that defines these types is included indirectly by the .xsd file with the global elements that uses them. For example, a global element "coordinateOperationRef" with a type "gml:CoordinateOperationPropertyType" is defined in file "deprecatedTypes.xsd". This file includes another schema, "gml.xsd", which in turn includes "coordinateReferenceSystems.xsd", which includes "coordinateOperations.xsd". The latter is where the type is defined. I don't know if it's relevant. But in this case, the type contains abstract elements. But not all the types that generate errors when compiling do. Regards, Guillermo From gfrontera at ucm.es Fri Mar 2 09:14:34 2018 From: gfrontera at ucm.es (Guillermo Frontera) Date: Sat Mar 3 11:28:12 2018 Subject: [xsd-users] Re: Missing includes in code generated from AIXM 5.1 In-Reply-To: References: Message-ID: Perhaps I should mention that, in the example above, the compiler complains that the C++ type CoordinateOperationPropertyType does not exist. Therefore, I must manually include the line: #include "CoordinateOperationPropertyType.hxx" And then it's fixed. I had to manually fix all the 42 missing types to get it to compile without errors. From matthieu.marseille at thales-services.fr Wed Mar 7 05:43:10 2018 From: matthieu.marseille at thales-services.fr (Matthieu MARSEILLE) Date: Wed Mar 7 08:30:42 2018 Subject: [xsd-users] [BUG] Error with xsdcxx returns -11 but nothing in STDERR Message-ID: <4dfa487437cdcd24827d90f98b3d8d37@thales-services.fr> Hi, Hoping that someone will read me : I'm currently trying to generate xml bindings using xsdcxx command line, but it returns an error code of -11 and nothing inside STDERR. What does that mean ? Thanks in advance. Matt From boris at codesynthesis.com Wed Mar 7 10:51:55 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Mar 7 10:54:40 2018 Subject: [xsd-users] [BUG] Error with xsdcxx returns -11 but nothing in STDERR In-Reply-To: <4dfa487437cdcd24827d90f98b3d8d37@thales-services.fr> References: <4dfa487437cdcd24827d90f98b3d8d37@thales-services.fr> Message-ID: Matthieu MARSEILLE writes: > Hoping that someone will read me : I'm currently trying to > generate xml bindings using xsdcxx command line, but it returns an error > code of -11 and nothing inside STDERR. Exit code -11 is segmentation fault. Try to run the command under the debugger and get a stack trace. Alternatively, you can try the latest pre-release: https://codesynthesis.com/~boris/tmp/xsd/4.1.0.a11/ Boris From gfrontera at ucm.es Fri Mar 23 08:12:00 2018 From: gfrontera at ucm.es (Guillermo Frontera) Date: Sat Mar 24 08:07:33 2018 Subject: [xsd-users] Re: Missing includes in code generated from AIXM 5.1 In-Reply-To: References: Message-ID: I kept looking into this. It turns out it in most cases it was not a matter of includes that were missing. It was, in fact, a circular dependency problem that caused some types to be used before they were defined, even with the --file-per-type option enabled. Enabling the --generate-forward option fixes most of the problems. However, one include must be still added manually. I am inclined to think this is a fault of GML 3.2.1 that has been corrected in later revisions. El vie., 2 mar. 2018 a las 15:14, Guillermo Frontera () escribi?: > Perhaps I should mention that, in the example above, the compiler > complains that the C++ type CoordinateOperationPropertyType does > not exist. Therefore, I must manually include the line: > > #include "CoordinateOperationPropertyType.hxx" > > And then it's fixed. I had to manually fix all the 42 missing types to > get it to compile without errors. >