[xsd-users] enumerations not exported in dll when "generate-inline" enabled

Matt Burnham mburnham at gblsys.com
Mon Feb 28 16:38:07 EST 2011


Using XSD (C++ / Tree) version 3.3

I have a schema that includes the following:

<xsd:simpleType name="action">
    <xsd:restriction base="xsd:string">
        <xsd:enumeration value="request"/>
        <xsd:enumeration value="response"/>
        <xsd:enumeration value="set_data"/>
    </xsd:restriction>
</xsd:simpleType>

The command line (along with the additional option --hxx-prologue "#include \"my_dll_export.h\"" ) for generating the C++ class is:

xsd.exe cxx-tree --generate-inline --generate-serialization --generate-ostream --generate-default-ctor --output-dir "." --hxx-suffix ".hxx" --cxx-suffix ".cxx" --ixx-suffix ".ixx" --fwd-suffix "-fwd.hxx" --namespace-map "=tmp" --export-symbol "MY_DLL_DECL"    

The resulting class is put in a DLL and when I try and link  an application with the DLL, I get the following link error:
unresolved external symbol "public: static char const * const * const tmp::action::_xsd_action_literals_" (?_xsd_action_literals_ at action@tmp@@2QBQBDB)

If I don't enable inline generation, everything works fine.

I'm attaching a zip file that contains a VS 2010 solution and projects to build both the DLL and application using the dll.  It uses the rules file the cxx-tree build step.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_xml.zip
Type: application/zip
Size: 5459 bytes
Desc: not available
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20110228/718607a6/test_xml.zip


More information about the xsd-users mailing list