From msantos at isaenergy.pt Wed May 6 07:36:15 2015 From: msantos at isaenergy.pt (Micael Santos) Date: Wed May 6 08:52:30 2015 Subject: [xsd-users] Cross compile c++ classes to use in openwrt Message-ID: Hello, Recently I have been trying to use codesynthesis to generate c++ classes from a xml schema for an embedded board that uses openwrt as it's operating system. So far I have been able to compile the xerces-c library using the feed bellow and it seems to be working fine. https://github.com/openwrt/packages/blob/master/libs/libxerces-c/Makefile Now when I try to execute the "hello world" example bellow I can't make it work on my board. But when I try it on my PC works fine. http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#2 I'm using eclipse to do the cross compiling which is been working fine for the other code using the following setttings Included libraries - xerces-c Compiler - i486-openwrt-linux-g++ I installed the package "xsd_4.0.0-1_i386.deb" on my computer in order to able to generate the c++ classes using the command $ xsd cxx-tree hello.xsd The only thing I had to "cheat" was copying the folder "/usr/include/xsd" to my cross compiler includes folder. I think probably the copying of the header was not the way to go but since it compiled afterwards I assumed it was ok. The problem is that I can't make the program run, getting the following output. When I compile it and run it on my pc without the cross compile it works fine. /tmp/hello.xml:1:29 error: no declaration found for element 'hello' /tmp/hello.xml:1:39 error: no declaration found for element 'greeting' /tmp/hello.xml:1:61 error: no declaration found for element 'name' /tmp/hello.xml:1:77 error: no declaration found for element 'name' /tmp/hello.xml:1:94 error: no declaration found for element 'name' Segmentation fault I tried everything that crossed my mind so far without luck. Anyone has any ideia what I'm making wrong? Do I need to compile the entire "XSD" using my cross compiler? And if so how will I call xsd from my pc since it was compiled for other platform? I'm sure must be something really simple but I'm kinda stuck :( Thanks for the help Micael Santos - Systems Engineer Phone: (+351) 239 791 400 [ISA] www.isaenergy.pt [Facebook] [Twitter] [LinkedIn] [YouTube] [GooglePlus] DISCLAIMER This message is confidential and intended exclusively for the addressee. If you received this message by mistake please inform the sender and delete the message and attachments. No confidentiality nor any privilege regarding the information is waived or lost by any mistransmission. Any views or opinions contained in this message are solely those of the author, and do not necessarily represent those of ISA Energy, unless specifically stated and the sender is authorized to do so. -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 11012 bytes Desc: image001.jpg Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20150506/7857b461/image001.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.png Type: image/png Size: 281 bytes Desc: image002.png Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20150506/7857b461/image002.png -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.png Type: image/png Size: 381 bytes Desc: image003.png Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20150506/7857b461/image003.png -------------- next part -------------- A non-text attachment was scrubbed... Name: image004.png Type: image/png Size: 2944 bytes Desc: image004.png Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20150506/7857b461/image004.png -------------- next part -------------- A non-text attachment was scrubbed... Name: image005.png Type: image/png Size: 357 bytes Desc: image005.png Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20150506/7857b461/image005.png -------------- next part -------------- A non-text attachment was scrubbed... Name: image006.png Type: image/png Size: 431 bytes Desc: image006.png Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20150506/7857b461/image006.png From boris at codesynthesis.com Wed May 6 13:48:13 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed May 6 13:48:20 2015 Subject: [xsd-users] Cross compile c++ classes to use in openwrt In-Reply-To: References: Message-ID: Hi Micael, Micael Santos writes: > The only thing I had to "cheat" was copying the folder "/usr/include/xsd" > to my cross compiler includes folder. I think probably the copying of > the header was not the way to go but since it compiled afterwards I > assumed it was ok. Yes, that shouldn't be a problem since those are compiler/platform- independent headers. > The problem is that I can't make the program run, getting the > following output. > > /tmp/hello.xml:1:29 error: no declaration found for element 'hello' > /tmp/hello.xml:1:39 error: no declaration found for element 'greeting' > /tmp/hello.xml:1:61 error: no declaration found for element 'name' > /tmp/hello.xml:1:77 error: no declaration found for element 'name' > /tmp/hello.xml:1:94 error: no declaration found for element 'name' This is XML Schema validation errors and the cause is most likely the .xsd file not being found. See: http://wiki.codesynthesis.com/Tree/FAQ#Why_do_I_get_.22error:_no_declaration_found_for_element_.27root-element.27.22_when_I_try_to_parse_a_valid_XML_document.3F Boris From msantos at isaenergy.pt Wed May 6 14:05:52 2015 From: msantos at isaenergy.pt (Micael Santos) Date: Wed May 6 14:06:04 2015 Subject: [xsd-users] Cross compile c++ classes to use in openwrt In-Reply-To: References: Message-ID: Hi, Thanks for the tip Boris. I tried to disable the xsd validation and it worked a bit better. Now I can see the xml tag contents :). Need to fiddle a bit more with xsd file location to make it work with the validation enabled but I think I will manage eventually. What worries me is that I still get a segmentation fault, that doesn't happen when I run the code in my pc. I checked the code for any sort of weirdness like buffer overruns but didn't find any. The code is exactly the same as in the "codesynthesis hello world" so I don't think it's a code problem but most likely some dependency missing... But in this case shouldn't my code fail to compile? Anyone had any similar experience? Isn't libxerces-c the only library needed after compilation? I ran out of ideias and don't know what else to try so any suggestion is welcome :) -----Mensagem original----- De: Boris Kolpackov [mailto:boris@codesynthesis.com] Enviada: 6 de maio de 2015 18:48 Para: Micael Santos Cc: xsd-users@codesynthesis.com Assunto: Re: [xsd-users] Cross compile c++ classes to use in openwrt Hi Micael, Micael Santos writes: > The only thing I had to "cheat" was copying the folder "/usr/include/xsd" > to my cross compiler includes folder. I think probably the copying of > the header was not the way to go but since it compiled afterwards I > assumed it was ok. Yes, that shouldn't be a problem since those are compiler/platform- independent headers. > The problem is that I can't make the program run, getting the > following output. > > /tmp/hello.xml:1:29 error: no declaration found for element 'hello' > /tmp/hello.xml:1:39 error: no declaration found for element 'greeting' > /tmp/hello.xml:1:61 error: no declaration found for element 'name' > /tmp/hello.xml:1:77 error: no declaration found for element 'name' > /tmp/hello.xml:1:94 error: no declaration found for element 'name' This is XML Schema validation errors and the cause is most likely the .xsd file not being found. See: http://wiki.codesynthesis.com/Tree/FAQ#Why_do_I_get_.22error:_no_declaration_found_for_element_.27root-element.27.22_when_I_try_to_parse_a_valid_XML_document.3F Boris From wpeters at aaski.com Wed May 6 17:13:37 2015 From: wpeters at aaski.com (Wesley Peters AASKI) Date: Wed May 6 17:13:39 2015 Subject: [xsd-users] Cross compile c++ classes to use in openwrt In-Reply-To: References: Message-ID: <7ABE7ED4-33FC-4725-B0F9-ED8EB372D913@aaski.com> The ?ldd? tool on your openwrt target will tell you if you have any unmet shared library dependencies. Normally this wouldn?t cause a crash, but rather refuse to start. Wes Peters AASKI Technology, Inc. www.AASKI.com wpeters@aaski.com On May 6, 2015, at 11:05 AM, Micael Santos wrote: > Hi, > > Thanks for the tip Boris. > I tried to disable the xsd validation and it worked a bit better. Now I can see the xml tag contents :). > Need to fiddle a bit more with xsd file location to make it work with the validation enabled but I think I will manage eventually. > What worries me is that I still get a segmentation fault, that doesn't happen when I run the code in my pc. > I checked the code for any sort of weirdness like buffer overruns but didn't find any. The code is exactly the same as in the "codesynthesis hello world" so I don't think it's a code problem but most likely some dependency missing... But in this case shouldn't my code fail to compile? > Anyone had any similar experience? Isn't libxerces-c the only library needed after compilation? I ran out of ideias and don't know what else to try so any suggestion is welcome :) > > -----Mensagem original----- > De: Boris Kolpackov [mailto:boris@codesynthesis.com] > Enviada: 6 de maio de 2015 18:48 > Para: Micael Santos > Cc: xsd-users@codesynthesis.com > Assunto: Re: [xsd-users] Cross compile c++ classes to use in openwrt > > Hi Micael, > > Micael Santos writes: > >> The only thing I had to "cheat" was copying the folder "/usr/include/xsd" >> to my cross compiler includes folder. I think probably the copying of >> the header was not the way to go but since it compiled afterwards I >> assumed it was ok. > > Yes, that shouldn't be a problem since those are compiler/platform- independent headers. > > >> The problem is that I can't make the program run, getting the >> following output. >> >> /tmp/hello.xml:1:29 error: no declaration found for element 'hello' >> /tmp/hello.xml:1:39 error: no declaration found for element 'greeting' >> /tmp/hello.xml:1:61 error: no declaration found for element 'name' >> /tmp/hello.xml:1:77 error: no declaration found for element 'name' >> /tmp/hello.xml:1:94 error: no declaration found for element 'name' > > This is XML Schema validation errors and the cause is most likely the .xsd file not being found. See: > > http://wiki.codesynthesis.com/Tree/FAQ#Why_do_I_get_.22error:_no_declaration_found_for_element_.27root-element.27.22_when_I_try_to_parse_a_valid_XML_document.3F > > Boris > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2115 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20150506/a95b675d/smime.bin From bjoern.stresing at gmx.de Thu May 7 08:46:58 2015 From: bjoern.stresing at gmx.de (=?UTF-8?B?QmrDtnJuIFN0cmVzaW5n?=) Date: Thu May 7 08:47:15 2015 Subject: [xsd-users] XSD compilation fails: "Global element declared more than once" Message-ID: <554B5EC2.4060805@gmx.de> Hello, I have a problem compiling a rather complicated schema with CodeSynthesis XSD XML Schema to C++ compiler 4.0.0. Since the schema is large and the definition spans some files with circular dependencies, I've tried to compile this beast in "--file-per-type" mode. However compilation fails with a bunch of "Global element xxx declared more than once" errors. I don't understand why the compiler complains since the schema seems to be valid (Eclipse says so). The schema (only Annex-B is of interest): http://standards.smpte.org/content/978-1-61482-595-1/suppl/2012/06/25/st-434-2006.DC1/st0434-2006.zip The XSD compiler arguments (I only need ./Annex-B/groups/s377m_metadata.xsd and all its dependencies): cxx-tree --options-file mxf.options --file-per-type --generate-serialization ./Annex-B/groups/s377m_metadata.xsd The mxf.options file: --namespace-map "http://www.smpte-ra.org/schemas/434/2006/types/S377M/2004=s377mTypes" --namespace-map "http://www.smpte-ra.org/schemas/434/2006/types/S422M/2006=s422mTypes" --namespace-map "http://www.smpte-ra.org/schemas/434/2006/groups/S377M/2004=s377mGroups" --namespace-map "http://www.smpte-ra.org/schemas/434/2006/groups/S381M/2005=s381mGroups" --namespace-map "http://www.smpte-ra.org/schemas/434/2006/groups/S385M/2004=s385mGroups" --namespace-map "http://www.smpte-ra.org/schemas/434/2006/groups/S380M/2004=s380mGroups" --namespace-map "http://www.smpte-ra.org/schemas/434/2006/groups/S422M/2006=s422mGroups" --namespace-map "http://www.smpte-ra.org/schemas/434/2006/groups/S429-6/2006=s429_6Groups" --root-element-none I hope there is some solution or workaround for this problem. Best Regards, Bjoern Stresing From boris at codesynthesis.com Fri May 8 15:09:19 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri May 8 15:09:25 2015 Subject: [xsd-users] Cross compile c++ classes to use in openwrt In-Reply-To: References: Message-ID: Hi Micael, Micael Santos writes: > What worries me is that I still get a segmentation fault, that > doesn't happen when I run the code in my pc. On embedded targets, when a program crashes after throwing an exception, the #1 thing to check, IME, is that the exception handling support is actually working. I've seen multiple times when a wrong runtime library was linked which resulted in non- functional exception handling but otherwise the application worked fine. Boris From boris at codesynthesis.com Fri May 8 15:28:32 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri May 8 15:28:36 2015 Subject: [xsd-users] XSD compilation fails: "Global element declared more than once" In-Reply-To: <554B5EC2.4060805@gmx.de> References: <554B5EC2.4060805@gmx.de> Message-ID: Hi Bj?rn, Bj?rn Stresing writes: > However compilation fails with a bunch of "Global element xxx > declared more than once" errors. I just downloaded the schema and used the options file and the command line exactly as in your email. I don't get the error that you are getting; everything compiles fine with 4.0.0. Perhaps you've changed the schema while trying to make it work without the --file-per-time option? Maybe try on the freshly unpacked original schema. If this still doesn't help, can you post the exact output that you are getting from the XSD compiler? Boris From robert.w.krajewski at gmail.com Fri May 8 16:56:19 2015 From: robert.w.krajewski at gmail.com (Robert Krajewski) Date: Fri May 8 20:16:48 2015 Subject: [xsd-users] Discovered a problem with the path environment variable causing hard to debug crashes on windows Message-ID: Hello everybody, the last days I nearly went bananas. As soon as I included the generated c++ classes to my project, my software instantly crashed at startup. I crashed without any error message and even before the debugger could attach to the program. At the moment I am working on my master thesis and so I have been really desperate the last days. But I found the solution to this problem. Because of the fact that this could be a common problem, I would like to make this post. So the problem was, that at startup the wrong .dll (on Windows) was loaded. Maybe the developers can give a hint to other users or even fix this issue. Here is a detailed description of my problem: I am using Windows 7 (64 bit), MSVC 2013 as Compiler and QT Creator as my IDE for my QT projects. If I try to build and run the examples in MSVC 2013 everything works fine. But if I tried to do the same in QT Creator, the examples instantly crashed. The problem have been the changes which XSD added to the path environment variable during the setup. The path is looking somewhat like this after installation: /bin;/bin64;.... The first part of the addition (../bin) caused the crashed. I guess the software tries to load the 32-bit dll while I compiled against the 64-bit dll. As soon as I removed the first part, there are no crashes. A solution to this problem could be that the order in which the bin directories are added to the path is switched. But I didn't test it yet. I hope my thread will help someone out there which is as desperate as I have been. Best regards, Robert From bjoern.stresing at gmx.de Sat May 9 08:37:52 2015 From: bjoern.stresing at gmx.de (=?windows-1252?Q?Bj=F6rn_Stresing?=) Date: Sat May 9 08:38:13 2015 Subject: [xsd-users] XSD compilation fails: "Global element declared more than once" In-Reply-To: References: <554B5EC2.4060805@gmx.de> Message-ID: <554DFFA0.50608@gmx.de> Hello Boris, thank you for your time. I downloaded the schema again as you recommended and run the xsd compiler (Windows binary from code synthesis download section). The same errors occur as shown below. Then I tried compiling under Linux and it worked like a charm. So xsd compiler seems to show different behavior under Windows. Is this a bug? Best Regards, Bjoern Stresing The errors I get under Windows: warning D002: --extern-xml-schema is recommended when --file-per-type is specified t o reduce generated code size groups/s377m_metadata.xsd:29:85: error: global element 'AbstractSet' declared more t han once groups/s377m_metadata.xsd:32:57: error: global type 'complexType:AbstractSetType' de clared more than once or also declared as simpleType groups/s377m_metadata.xsd:50:97: error: global element 'InterchangeObject' declared more than once groups/s377m_metadata.xsd:53:63: error: global type 'complexType:InterchangeObjectTy pe' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:75:91: error: global element 'SubDescriptors' declared mor e than once groups/s377m_metadata.xsd:78:60: error: global type 'complexType:SubDescriptorsType' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:92:103: error: global element 'DescriptiveFramework' decla red more than once groups/s377m_metadata.xsd:95:66: error: global type 'complexType:DescriptiveFramewor kType' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:110:97: error: global element 'DescriptiveObject' declared more than once groups/s377m_metadata.xsd:113:63: error: global type 'complexType:DescriptiveObjectT ype' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:128:73: error: global element 'Track' declared more than o nce groups/s377m_metadata.xsd:131:51: error: global type 'complexType:TrackType' declare d more than once or also declared as simpleType groups/s377m_metadata.xsd:170:77: error: global element 'Package' declared more than once groups/s377m_metadata.xsd:173:53: error: global type 'complexType:PackageType' decla red more than once or also declared as simpleType groups/s377m_metadata.xsd:218:81: error: global element 'Component' declared more th an once groups/s377m_metadata.xsd:221:55: error: global type 'complexType:ComponentType' dec lared more than once or also declared as simpleType groups/s377m_metadata.xsd:250:77: error: global element 'Segment' declared more than once groups/s377m_metadata.xsd:253:53: error: global type 'complexType:SegmentType' decla red more than once or also declared as simpleType groups/s377m_metadata.xsd:265:93: error: global element 'SourceReference' declared m ore than once groups/s377m_metadata.xsd:268:61: error: global type 'complexType:SourceReferenceTyp e' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:307:81: error: global element 'DMS1Event' declared more th an once groups/s377m_metadata.xsd:310:55: error: global type 'complexType:DMS1EventType' dec lared more than once or also declared as simpleType groups/s377m_metadata.xsd:335:89: error: global element 'CommentMarker' declared mor e than once groups/s377m_metadata.xsd:338:59: error: global type 'complexType:CommentMarkerType' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:350:97: error: global element 'GenericDescriptor' declared more than once groups/s377m_metadata.xsd:353:63: error: global type 'complexType:GenericDescriptorT ype' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:379:99: error: global element 'PhysicalDescriptor' declare d more than once groups/s377m_metadata.xsd:382:64: error: global type 'complexType:PhysicalDescriptor Type' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:396:77: error: global element 'Locator' declared more than once groups/s377m_metadata.xsd:399:53: error: global type 'complexType:LocatorType' decla red more than once or also declared as simpleType groups/s377m_metadata.xsd:418:56: error: global element 'Preface_REF' declared more than once groups/s377m_metadata.xsd:420:60: error: global element 'Preface' declared more than once groups/s377m_metadata.xsd:427:37: error: global type 'complexType:PrefaceType' decla red more than once or also declared as simpleType groups/s377m_metadata.xsd:496:63: error: global element 'Identification_REF' declare d more than once groups/s377m_metadata.xsd:498:74: error: global element 'Identification' declared mo re than once groups/s377m_metadata.xsd:506:44: error: global type 'complexType:IdentificationType ' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:575:63: error: global element 'ContentStorage_REF' declare d more than once groups/s377m_metadata.xsd:577:74: error: global element 'ContentStorage' declared mo re than once groups/s377m_metadata.xsd:584:44: error: global type 'complexType:ContentStorageType ' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:611:60: error: global element 'EssenceData_REF' declared m ore than once groups/s377m_metadata.xsd:613:68: error: global element 'EssenceData' declared more than once groups/s377m_metadata.xsd:620:41: error: global type 'complexType:EssenceDataType' d eclared more than once or also declared as simpleType groups/s377m_metadata.xsd:653:63: error: global element 'NetworkLocator_REF' declare d more than once groups/s377m_metadata.xsd:655:74: error: global element 'NetworkLocator' declared mo re than once groups/s377m_metadata.xsd:662:44: error: global type 'complexType:NetworkLocatorType ' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:683:60: error: global element 'TextLocator_REF' declared m ore than once groups/s377m_metadata.xsd:685:68: error: global element 'TextLocator' declared more than once groups/s377m_metadata.xsd:692:41: error: global type 'complexType:TextLocatorType' d eclared more than once or also declared as simpleType groups/s377m_metadata.xsd:713:62: error: global element 'TimelineTrack_REF' declared more than once groups/s377m_metadata.xsd:715:72: error: global element 'TimelineTrack' declared mor e than once groups/s377m_metadata.xsd:722:43: error: global type 'complexType:TimelineTrackType' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:749:59: error: global element 'EventTrack_REF' declared mo re than once groups/s377m_metadata.xsd:751:66: error: global element 'EventTrack' declared more t han once groups/s377m_metadata.xsd:759:40: error: global type 'complexType:EventTrackType' de clared more than once or also declared as simpleType groups/s377m_metadata.xsd:786:60: error: global element 'StaticTrack_REF' declared m ore than once groups/s377m_metadata.xsd:788:68: error: global element 'StaticTrack' declared more than once groups/s377m_metadata.xsd:796:41: error: global type 'complexType:StaticTrackType' d eclared more than once or also declared as simpleType groups/s377m_metadata.xsd:808:57: error: global element 'Sequence_REF' declared more than once groups/s377m_metadata.xsd:810:62: error: global element 'Sequence' declared more tha n once groups/s377m_metadata.xsd:817:38: error: global type 'complexType:SequenceType' decl ared more than once or also declared as simpleType groups/s377m_metadata.xsd:838:57: error: global element 'Timecode_REF' declared more than once groups/s377m_metadata.xsd:840:62: error: global element 'Timecode' declared more tha n once groups/s377m_metadata.xsd:848:38: error: global type 'complexType:TimecodeType' decl ared more than once or also declared as simpleType groups/s377m_metadata.xsd:882:66: error: global element 'DescriptiveMarker_REF' decl ared more than once groups/s377m_metadata.xsd:884:80: error: global element 'DescriptiveMarker' declared more than once groups/s377m_metadata.xsd:892:47: error: global type 'complexType:DescriptiveMarkerT ype' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:919:59: error: global element 'SourceClip_REF' declared mo re than once groups/s377m_metadata.xsd:921:66: error: global element 'SourceClip' declared more t han once groups/s377m_metadata.xsd:928:40: error: global type 'complexType:SourceClipType' de clared more than once or also declared as simpleType groups/s377m_metadata.xsd:949:64: error: global element 'DescriptiveClip_REF' declar ed more than once groups/s377m_metadata.xsd:951:76: error: global element 'DescriptiveClip' declared m ore than once groups/s377m_metadata.xsd:959:45: error: global type 'complexType:DescriptiveClipTyp e' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:999:64: error: global element 'MaterialPackage_REF' declar ed more than once groups/s377m_metadata.xsd:1001:76: error: global element 'MaterialPackage' declared more than once groups/s377m_metadata.xsd:1009:45: error: global type 'complexType:MaterialPackageTy pe' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:1021:62: error: global element 'SourcePackage_REF' declare d more than once groups/s377m_metadata.xsd:1023:72: error: global element 'SourcePackage' declared mo re than once groups/s377m_metadata.xsd:1031:43: error: global type 'complexType:SourcePackageType ' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:1052:63: error: global element 'FileDescriptor_REF' declar ed more than once groups/s377m_metadata.xsd:1054:74: error: global element 'FileDescriptor' declared m ore than once groups/s377m_metadata.xsd:1061:44: error: global type 'complexType:FileDescriptorTyp e' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:1107:66: error: global element 'PictureDescriptor_REF' dec lared more than once groups/s377m_metadata.xsd:1109:80: error: global element 'PictureDescriptor' declare d more than once groups/s377m_metadata.xsd:1117:47: error: global type 'complexType:PictureDescriptor Type' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:1281:63: error: global element 'CDCIDescriptor_REF' declar ed more than once groups/s377m_metadata.xsd:1283:74: error: global element 'CDCIDescriptor' declared m ore than once groups/s377m_metadata.xsd:1291:44: error: global type 'complexType:CDCIDescriptorTyp e' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:1368:63: error: global element 'RGBADescriptor_REF' declar ed more than once groups/s377m_metadata.xsd:1370:74: error: global element 'RGBADescriptor' declared m ore than once groups/s377m_metadata.xsd:1378:44: error: global type 'complexType:RGBADescriptorTyp e' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:1442:64: error: global element 'SoundDescriptor_REF' decla red more than once groups/s377m_metadata.xsd:1444:76: error: global element 'SoundDescriptor' declared more than once groups/s377m_metadata.xsd:1451:45: error: global type 'complexType:SoundDescriptorTy pe' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:1517:70: error: global element 'DataEssenceDescriptor_REF' declared more than once groups/s377m_metadata.xsd:1519:88: error: global element 'DataEssenceDescriptor' dec lared more than once groups/s377m_metadata.xsd:1527:51: error: global type 'complexType:DataEssenceDescri ptorType' declared more than once or also declared as simpleType groups/s377m_metadata.xsd:1548:67: error: global element 'MultipleDescriptor_REF' de clared more than once groups/s377m_metadata.xsd:1550:82: error: global element 'MultipleDescriptor' declar ed more than once groups/s377m_metadata.xsd:1558:48: error: global type 'complexType:MultipleDescripto rType' declared more than once or also declared as simpleTyp > Hi Bj?rn, > > Bj?rn Stresing writes: > >> However compilation fails with a bunch of "Global element xxx >> declared more than once" errors. > I just downloaded the schema and used the options file and the > command line exactly as in your email. I don't get the error that > you are getting; everything compiles fine with 4.0.0. > > Perhaps you've changed the schema while trying to make it work > without the --file-per-time option? Maybe try on the freshly > unpacked original schema. > > If this still doesn't help, can you post the exact output > that you are getting from the XSD compiler? > > Boris -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4231 bytes Desc: S/MIME Cryptographic Signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20150509/00506fbd/smime.bin From boris at codesynthesis.com Sun May 10 14:14:40 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun May 10 14:14:47 2015 Subject: [xsd-users] XSD compilation fails: "Global element declared more than once" In-Reply-To: <554DFFA0.50608@gmx.de> References: <554B5EC2.4060805@gmx.de> <554DFFA0.50608@gmx.de> Message-ID: Hi Bj?rn, Bj?rn Stresing writes: > thank you for your time. I downloaded the schema again as you > recommended and run the xsd compiler (Windows binary from code > synthesis download section). The same errors occur as shown below. > Then I tried compiling under Linux and it worked like a charm. So > xsd compiler seems to show different behavior under Windows. Ok, now it is starting to make sense. I believe this is a known bug that has been fixed in the repository. Could you try the following pre-release binary to confirm this: http://codesynthesis.com/~boris/tmp/xsd/xsd-4.1.0.a3-i686-windows.zip Boris From boris at codesynthesis.com Sun May 10 14:21:23 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun May 10 14:21:30 2015 Subject: [xsd-users] Discovered a problem with the path environment variable causing hard to debug crashes on windows In-Reply-To: References: Message-ID: Hi Robert, Thanks for taking the time to describe the problem and workaround, this is much appreciated. Please also see my comment below. Robert Krajewski writes: > I am using Windows 7 (64 bit), MSVC 2013 as Compiler and QT Creator as my > IDE for my QT projects. If I try to build and run the examples in MSVC > 2013 everything works fine. But if I tried to do the same in QT Creator, > the examples instantly crashed. > > The problem have been the changes which XSD added to the path environment > variable during the setup. The path is looking somewhat like this after > installation: > > /bin;/bin64;.... > > The first part of the addition (../bin) caused the crashed. I guess the > software tries to load the 32-bit dll while I compiled against the 64-bit > dll. Windows dynamic library loader (at least for 64-bit applications) will skip 32-bit DLLs and will keep searching the PATH list for a 64-bit version. This is the reason the installer adds the paths in the order that you see. Also, the fact that everything works with MSVC confirms this (and that also what we have observed in our tests). So I tend to think it is QTCreator that is to blame here. You may want to check on its forums/mailing lists if this is a known issue. Boris From msantos at isaenergy.pt Mon May 11 05:18:28 2015 From: msantos at isaenergy.pt (Micael Santos) Date: Mon May 11 05:18:39 2015 Subject: [xsd-users] Cross compile c++ classes to use in openwrt In-Reply-To: References: Message-ID: Hi Boris, I tried to throw an exception manually and it worked fine with no segmentation faults. The exception wasn't related in any way to the xerces library but I don't think it would make a difference. I read in the link[1] a segmentation fault can be generated on the destructor call I will investigate if that may be the problem. One curious fact is that when I installed the xerces library it also installed uclibc++ as dependency needed. This lead me to think maybe I would need to add uclibc++ to my list of libraries at compilation time. I did that and the result was even worst making the program not work at all. Looking at the examples on the codesynthesis page libxerces seems to be the only dependency needed so I'm a bit unsure if that's true for all targets or only "regular pc's" [1] http://www.codesynthesis.com/pipermail/xsd-users/2007-November/001379.html Do you have any other suggestion I may try to find what's going wrong? Odds are it's some little thing I'm overlooking :) -----Mensagem original----- De: Boris Kolpackov [mailto:boris@codesynthesis.com] Enviada: 8 de maio de 2015 20:09 Para: Micael Santos Cc: xsd-users@codesynthesis.com Assunto: Re: [xsd-users] Cross compile c++ classes to use in openwrt Hi Micael, Micael Santos writes: > What worries me is that I still get a segmentation fault, that doesn't > happen when I run the code in my pc. On embedded targets, when a program crashes after throwing an exception, the #1 thing to check, IME, is that the exception handling support is actually working. I've seen multiple times when a wrong runtime library was linked which resulted in non- functional exception handling but otherwise the application worked fine. Boris From boris at codesynthesis.com Mon May 11 07:12:49 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon May 11 07:12:57 2015 Subject: [xsd-users] Cross compile c++ classes to use in openwrt In-Reply-To: References: Message-ID: Hi Micael, Micael Santos writes: > One curious fact is that when I installed the xerces library it also > installed uclibc++ as dependency needed. If Xerces-C++ was built to use uclibc++ as a standard library, then you need to make sure your application is also built to use this library. Having different standard libraries used by parts of your application is exactly the kind of situation that would lead to a seg fault. Run ldd on your resulting executable and make sure you don't see both uclibc++ and libstdc++. Another thing to check is that you don't terminate the Xerces-C++ runtime too early, if you are initializing it yourself. But the best way, of course, is to fire up gdb and find out exactly what's going on (i.e., the stack trace) instead of guessing. Boris From bjoern.stresing at gmx.de Wed May 13 03:52:57 2015 From: bjoern.stresing at gmx.de (=?windows-1252?Q?Bj=F6rn_Stresing?=) Date: Wed May 13 03:53:11 2015 Subject: [xsd-users] XSD compilation fails: "Global element declared more than once" In-Reply-To: References: <554B5EC2.4060805@gmx.de> <554DFFA0.50608@gmx.de> Message-ID: <555302D9.80406@gmx.de> Hello Boris, the pre-release binary works perfectly. Thanks a lot. Best Regards, Bjoern Stresing > Hi Bj?rn, > > Bj?rn Stresing writes: >> thank you for your time. I downloaded the schema again as you >> recommended and run the xsd compiler (Windows binary from code >> synthesis download section). The same errors occur as shown below. >> Then I tried compiling under Linux and it worked like a charm. So >> xsd compiler seems to show different behavior under Windows. > Ok, now it is starting to make sense. I believe this is a known > bug that has been fixed in the repository. Could you try the > following pre-release binary to confirm this: > > http://codesynthesis.com/~boris/tmp/xsd/xsd-4.1.0.a3-i686-windows.zip > > Boris -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4231 bytes Desc: S/MIME Cryptographic Signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20150513/93fac176/smime.bin From bjoern.stresing at gmx.de Wed May 13 09:33:34 2015 From: bjoern.stresing at gmx.de (=?windows-1252?Q?Bj=F6rn_Stresing?=) Date: Wed May 13 09:33:46 2015 Subject: [xsd-users] XSD compilation fails: "Global element declared more than once" In-Reply-To: <555302D9.80406@gmx.de> References: <554B5EC2.4060805@gmx.de> <554DFFA0.50608@gmx.de> <555302D9.80406@gmx.de> Message-ID: <555352AE.8040207@gmx.de> Hi again, I have to correct myself. The xsd binary runs through without throwing errors but the generated code won't compile with visual studio compiler 12. Even worse, a schema that previously worked with xsd binary version 4.0.0 and visual studio stopped working (see below). The changelog shows that version 4.1.0 has a new feature (support for abstract XML Schema types). This feature probably causes the errors (every abstract xsd type triggers one error). Is there a command line option to disable this feature? The schema that stopped working using xsd binary 4.1.0: https://dl.dropboxusercontent.com/u/85154074/xsd.zip Best Regards, Bjoern Stresing 1>------ Build started: Project: Archivist, Configuration: Debug Win32 ------ 1> imf-cpl.cpp 1>D:\DEV\xsd\libxsd\xsd/cxx/tree/elements.hxx(1495): error C2259: 'cpl::BaseResourceType' : cannot instantiate abstract class 1> due to following members: 1> 'cpl::BaseResourceType *cpl::BaseResourceType::_clone(xml_schema::Flags,xsd::cxx::tree::_type *) const' : is abstract 1> d:\svn\archivist\trunk\src\synthesis\imf-cpl.h(1596) : see declaration of 'cpl::BaseResourceType::_clone' 1> D:\DEV\xsd\libxsd\xsd/cxx/tree/elements.hxx(1494) : while compiling class template member function 'std::auto_ptr xsd::cxx::tree::traits::create(const xercesc_3_1::DOMElement &,xsd::cxx::tree::flags,xsd::cxx::tree::container *)' 1> with 1> [ 1> T=cpl::SequenceType_ResourceListType::ResourceType 1> ] 1> D:\SVN\archivist\trunk\src\synthesis\imf-cpl.cpp(4912) : see reference to function template instantiation 'std::auto_ptr xsd::cxx::tree::traits::create(const xercesc_3_1::DOMElement &,xsd::cxx::tree::flags,xsd::cxx::tree::container *)' being compiled 1> with 1> [ 1> T=cpl::SequenceType_ResourceListType::ResourceType 1> ] 1> D:\SVN\archivist\trunk\src\synthesis\imf-cpl.cpp(4912) : see reference to class template instantiation 'xsd::cxx::tree::traits' being compiled 1> st2067-100a-2014.cpp 1>D:\DEV\xsd\libxsd\xsd/cxx/tree/elements.hxx(1495): error C2259: 'opl::MacroType' : cannot instantiate abstract class 1> due to following members: 1> 'opl::MacroType *opl::MacroType::_clone(xml_schema::Flags,xsd::cxx::tree::_type *) const' : is abstract 1> d:\svn\archivist\trunk\src\synthesis\st2067-100a-2014.h(611) : see declaration of 'opl::MacroType::_clone' 1> D:\DEV\xsd\libxsd\xsd/cxx/tree/elements.hxx(1494) : while compiling class template member function 'std::auto_ptr xsd::cxx::tree::traits::create(const xercesc_3_1::DOMElement &,xsd::cxx::tree::flags,xsd::cxx::tree::container *)' 1> with 1> [ 1> T=opl::OutputProfileListType_MacroListType::MacroType 1> ] 1> D:\SVN\archivist\trunk\src\synthesis\st2067-100a-2014.cpp(1367) : see reference to function template instantiation 'std::auto_ptr xsd::cxx::tree::traits::create(const xercesc_3_1::DOMElement &,xsd::cxx::tree::flags,xsd::cxx::tree::container *)' being compiled 1> with 1> [ 1> T=opl::OutputProfileListType_MacroListType::MacroType 1> ] 1> D:\SVN\archivist\trunk\src\synthesis\st2067-100a-2014.cpp(1367) : see reference to class template instantiation 'xsd::cxx::tree::traits' being compiled 1> Generating Code... ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ========== -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4231 bytes Desc: S/MIME Cryptographic Signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20150513/eab20d04/smime.bin From boris at codesynthesis.com Thu May 14 16:26:13 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu May 14 16:26:13 2015 Subject: [xsd-users] XSD compilation fails: "Global element declared more than once" In-Reply-To: <555352AE.8040207@gmx.de> References: <554B5EC2.4060805@gmx.de> <554DFFA0.50608@gmx.de> <555302D9.80406@gmx.de> <555352AE.8040207@gmx.de> Message-ID: Hi Bj?rn, Bj?rn Stresing writes: > The schema that stopped working using xsd binary 4.1.0: > > 'cpl::BaseResourceType' : cannot instantiate abstract class Ok, I took a look and here is what happens: BaseResourceType is abstract but is used as a type of an element. This means that this type (hierarchy) is polymorphic. You, however, do not tell the XSD compiler as much (--polymorphic-type option). In the previous versions of XSD this would result in wrong runtime behavior. Now that XSD translates abstract XML Schema types to abstract C++ classes, this results in a compile-time error (admittedly a bit obscure). Boris