[xsd-users] RE: Linker conflict when generating code from 2 different XML files with identically-named elements

Garry Jeromson garry.jeromson at enclustra.com
Thu Feb 12 13:20:03 EST 2015


Hello,

I have a problem in code where I'd like to parse 2 different XML files (with different schemas) - when compiling, I get a bunch of linker errors like this:

error LNK2005: "protected: void __thiscall ConfigurationProperty::parse(class xsd::cxx::xml::dom::parser<char> &,class xsd::cxx::tree::flags)" (?parse at ConfigurationProperty@@IAEXAAV?$parser at D@dom at xml@cxx at xsd@@Vflags at tree@56@@Z) already defined in EepromMemoryMaps.obj


The reason is clear - the ConfigurationProperty element in the XML schema generates the same code in both generated .cxx files. The question is, is there a smart way to deal with this? If possible I'd like to avoid renaming the elements in the schema and having to edit generated files by hand, if possible.

Any tips are much appreciated.

Cheers,

Garry


More information about the xsd-users mailing list