c++ - Undefined reference to typeinfo for Code Synthesis generated Class -
I have an XSD schema that uses the replacement group (multipath type). Java schema is used in Java and C ++, Java and JACAB are easy and I do not have any problems there. I am using code synthesis to generate C ++ classes for schema and this is where I am having trouble.
command line Argengs:
xsdcxx cxx-tree \ - -namespace- map "http: //" ... "=" csspap_xsd "\ --hxx- Credit .hpp \ --cxx- suffix CPP \ --generate- polymorphic \ --polymorphic type all \ - -generate- sequence \ --root- elements-all \ Schema.xsd
< p> the basis of the 'MessageType' and there are three abstract types (RequestMessageType, ResponseMessageType, and UnsolicitedMessageType) expand that base type. many messages to expand these types. I'm playing with one I SuccessResponeType which extends ResponseMessageType . Point to a MessageType The form is to be able to pass around the message. I am trying to determine which type of message is being handled.
Schema Snippet:
& lt; xs: element name & = "message" type = "messageType" gt; & lt; xs: annotation & gt; & lt; xs: documentation & gt; Roo T standard message & lt; / Xs: Documentation & gt; & lt; / XS: Annotation & gt; & lt; / XS: element & gt; & Lt; X: complex type name = "message type" abstract = "true" & gt; & Lt; XS: Annotation & gt; & Lt; Xs: Documentation & gt; Represents a request, response, or unwanted response message & lt; / Xs: Documentation & gt; & Lt; / XS: Annotation & gt; & Lt; / XS: complexType & gt; & Lt; Xs: complex type name = "responses type" abstract = "true" & gt; & Lt; XS: Annotation & gt; & Lt; Xs: Documentation & gt; All response message types & lt; / Xs: Documentation & gt; & Lt; / XS: Annotation & gt; & Lt; XS: complexContent & gt; & Lt; Xs: extension base = "MessageType" /> & Lt; / XS: complexContent & gt; & Lt; / XS: complexType & gt; & Lt; X: complex type name = "success type" & gt; & Lt; XS: complexContent & gt; & Lt; X: extension base = "response message type" & gt; & Lt; XS: Sequence & gt; & Lt; Xs: element name = "comment" type = "x: string" /> & Lt; / XS: sequence & gt; & Lt; / XS: Expansion & gt; & Lt; / XS: complexContent & gt; & Lt; / XS: complexType & gt; & Lt; Xs: element name = "success" type = "success type" replacement group = "message" />
The schema is a code inside CPP file that compares classes:
const :: csspap_xsd :: SuccessType & amp; S; If (typeid (:: csspap_xsd :: SuccessResponseType) == (typeid (s)) {// this is a SuccessResponseType}
So in theory I was able to do something like this Should be in my class to check the nature of the message
In my test class, I try to print typeinfo.name for SuccessResponseType:.
#include & lt; typeinfo & gt; # include & lt; iostream & gt; #include "Schema.hpp" int main () {std :: court & lt; & lt; "schema SuccessResponseType name:" & Lt; & lt; typeid (csspap_xsd :: SuccessResponseType) .name & lt ; & Lt; std :: endl; return 0;}
But when I try to compile my test class, then type "csspap_xsd :: SuccessResponseType" for typeinfo "Undefined reference" message.
I have read the arguments for XSDCX several times ... and I do not know what I'm missing and I type for my schema classes Why can not I get the information?
Any help would be greatly appreciated!
-Ac
You are making a very basic error, without you Can not declare any reference to an earlier version:
const :: csspap_xsd :: SuccessResponseType & amp; S;