[xsde-users] error "unable to open in read mode"
Rashi Jha
rashij at cybage.com
Thu Jul 28 02:20:06 EDT 2011
Hi Boris,
Thank you very much for taking the time to reply to me. It really helped me. Now the generated classes are compiling successfully.
But now I am facing another issue when trying to build the driver for a sample "hello" application as provided in the C++/Hybrid mapping getting started guide.
I tried to follow the below steps to compile & build the driver:
1. Built the libxsde.a library using steps mentioned in ios/README - [Done]
2. Created hello.xsd and hello.xml. - [Done]
3. Got driver.o, hello.o, hello-pskel.o, hello-pimpl.o files generated using the driver.cxx file. - [Done]
4. Now when I try to create binary of driver linking .o files using below command: - [Failed]
# c++/g++ -o driver driver.o hello.o hello-pskel.o hello-pimpl.o somePathToMyLibxsdeBuildFolder/libxsde.a
It gives me error saying architecture missing for x86_64 & vtable specific errors too. I have tried to find if there is any specific macro getting passed but unable to figure out.
Will you please help in finding a solution to this? Also, please send me the binary with the fixes that you have made. Please find the error log file in the attachments and details of my Mac.
Regards
Rashi
-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com]
Sent: Wednesday, July 27, 2011 3:11 PM
To: Rashi Jha
Cc: xsde-users at codesynthesis.com; Amit Jain
Subject: Re: [xsde-users] error "unable to open in read mode"
Hi Rashi,
Rashi Jha <rashij at cybage.com> writes:
> I was able to generate C++ classes for the file POCD_MT000040.xsd .
> But now when I add all the files in my project and build the project,
> I get 4 errors in file POCD_MT000040-pskel.cpp as:
>
> 1. error: invalid conversion from 'v3::ED*' to 'v3::thumbnail*'
> 2 . error: initializing argument 1 of 'virtual void v3::ED_pskel::thumbnail(v3::thumbnail*)'
> 3. error: 'class v3::cs_pskel' has no member named 'post_TimingEvent'
> 4. error: no matching function for call to 'v3::EIVL_event_pskel::code(const v3::TimingEvent&)'
I finally got around to looking into this. First of all, I fixed a couple of problems in XSD/e that has to do with chameleon-style inclusion (used in your schemas). Now I am able to generate the C++ code without any errors or seg faults and any modifications to the schemas. I can build you a pre-release binary with these fixes if you would like (just let me know on which platform you run the XSD/e compiler).
However, when compiling the generated code with a C++ compiler, I get exactly the same errors as you showed above. I investigated it further and they are all caused by complex inheritance-by-restriction use cases.
In general, inheritance-by-restriction in XML Schema does not map cleanly to C++ inheritance and XSD/e compiler has a limited support for this feature. A work around for this problem is to relax the schema a little bit (if you need, you can "tighten" things back by adding a few checks in your application or by customizing the parser implementations and performing those checks there).
So here are the two changes I had to make to allow the generated code to compile successfully:
1. In datatype-base.xsd in type ST line 311, change the thumbnail
element definition from:
<xs:element name="thumbnail" type="ED" minOccurs="0" maxOccurs="0"/>
To:
<xs:element name="thumbnail" type="thumbnail" minOccurs="0" maxOccurs="0"/>
2. In datatype-base.xsd in type EIVL.event line 1690, change the code
attribute definition from:
<xs:attribute name="code" type="TimingEvent" use="optional"/>
To:
<xs:attribute name="code" type="cs" use="optional"/>
Boris
"Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment."
www.cybage.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: errorLog.rtf
Type: application/rtf
Size: 48892 bytes
Desc: errorLog.rtf
Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20110728/e17c5354/errorLog-0001.rtf
-------------- next part --------------
MAC OS X Version - 10.6.5
SDKs:
Mac OS X:
10.5: (9L31a)
10.6: (10M2423)
iPhone OS:
4.2: (8C134)
iPhone Simulator:
3.2: (7W367a)
4.0: (8A400)
4.1: (8B117)
4.2: (8C134)
Compiler versions tried:
XXXX-Mac-mini:Classes rashij$ c++ -version
i686-apple-darwin10-g++-4.2.1: no input files
XXXX-Mac-mini:Classes rashij$ g++ -version
i686-apple-darwin10-g++-4.2.1: no input files
XXXX-Mac-mini:Classes rashij$ uname -a
Darwin XXXX-Mac-mini.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386
More information about the xsde-users
mailing list