From Bernard.T.Harris at nasa.gov Wed Apr 6 07:53:49 2016 From: Bernard.T.Harris at nasa.gov (Bernie Harris) Date: Wed Apr 6 07:55:51 2016 Subject: [xsd-users] Error compiling char-utf8.txx with Solaris Studio 12.4 c++11 Message-ID: <5704F8CD.1070307@nasa.gov> Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 7270 bytes Desc: S/MIME Cryptographic Signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20160406/c0cae3be/smime.bin From boris at codesynthesis.com Wed Apr 6 08:47:05 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Apr 6 08:46:53 2016 Subject: [xsd-users] Error compiling char-utf8.txx with Solaris Studio 12.4 c++11 In-Reply-To: <5704F8CD.1070307@nasa.gov> References: <5704F8CD.1070307@nasa.gov> Message-ID: Hi Bernie, Wow, Sun CC in the C++11 mode. Never thought I would live to see the day ;-) Can you try the attached patch (on libxsd) and see if it helps? Thanks, Boris -------------- next part -------------- A non-text attachment was scrubbed... Name: char-utf8.patch Type: text/x-diff Size: 641 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20160406/f7928e25/char-utf8.bin From Bernard.T.Harris at nasa.gov Wed Apr 6 09:14:20 2016 From: Bernard.T.Harris at nasa.gov (Bernie Harris) Date: Wed Apr 6 09:48:59 2016 Subject: [xsd-users] Error compiling char-utf8.txx with Solaris Studio 12.4 c++11 In-Reply-To: References: <5704F8CD.1070307@nasa.gov> Message-ID: <57050BAC.9020901@nasa.gov> Thanks, that fixed the compile error. Now I've got this > $ gmake XSDFLAGS="--std c++11" CXX=CC > CPPFLAGS="-I/usr/local/xerces-c/include" CXXFLAGS="-std=c++11" > LDFLAGS="-L /usr/local/xerces-c/lib -R /> > CC -std=c++11 -L /usr/local/xerces-c/lib -R /usr/local/xerces-c/lib -o > driver driver.o library.o -lxerces-c > Undefined first referenced > symbol in file > typeinfo for xercesc_3_1::DOMLSException library.o > [Hint: static member typeinfo for xercesc_3_1::DOMLSException must be > defined in the program] > > xercesc_3_1::InputSource::setSystemId(const unsigned short*) library.o > xercesc_3_1::XMLUni::fgDOMXMLDeclaration library.o > [Hint: static member xercesc_3_1::XMLUni::fgDOMXMLDeclaration must be > defined in the program] > > xercesc_3_1::XMLUni::fgDOMElementContentWhitespace library.o > [Hint: static member > xercesc_3_1::XMLUni::fgDOMElementContentWhitespace must be defined in > the program] > > typeinfo for xercesc_3_1::BinInputStream library.o > [Hint: static member typeinfo for xercesc_3_1::BinInputStream must be > defined in the program] > > xercesc_3_1::XMLUni::fgXMLNSURIName library.o > [Hint: static member xercesc_3_1::XMLUni::fgXMLNSURIName must be > defined in the program] > > xercesc_3_1::XMemory::operator delete(void*) library.o > xercesc_3_1::XMLUni::fgDOMEntities library.o > [Hint: static member xercesc_3_1::XMLUni::fgDOMEntities must be > defined in the program] > > xercesc_3_1::SchemaSymbols::fgXSI_SCHEMALOCACTION library.o > [Hint: static member xercesc_3_1::SchemaSymbols::fgXSI_SCHEMALOCACTION > must be defined in the program] > > xercesc_3_1::InputSource::~InputSource() library.o > xercesc_3_1::BinInputStream::BinInputStream() library.o > xercesc_3_1::BinInputStream::~BinInputStream() library.o > xercesc_3_1::XMLUni::fgXercesUserAdoptsDOMDocument library.o > [Hint: static member > xercesc_3_1::XMLUni::fgXercesUserAdoptsDOMDocument must be defined in > the program] > > xercesc_3_1::InputSource::InputSource(xercesc_3_1::MemoryManager*) > library.o > xercesc_3_1::XMLUni::fgDOMWRTFormatPrettyPrint library.o > [Hint: static member xercesc_3_1::XMLUni::fgDOMWRTFormatPrettyPrint > must be defined in the program] > > xercesc_3_1::XMLUni::fgDOMWRTXercesPrettyPrint library.o > [Hint: static member xercesc_3_1::XMLUni::fgDOMWRTXercesPrettyPrint > must be defined in the program] > > xercesc_3_1::XMLUni::fgXercesHandleMultipleImports library.o > [Hint: static member > xercesc_3_1::XMLUni::fgXercesHandleMultipleImports must be defined in > the program] > > typeinfo for xercesc_3_1::InputSource library.o > [Hint: static member typeinfo for xercesc_3_1::InputSource must be > defined in the program] > > xercesc_3_1::InputSource::setPublicId(const unsigned short*) library.o > xercesc_3_1::XMLUni::fgXercesLoadSchema library.o > [Hint: static member xercesc_3_1::XMLUni::fgXercesLoadSchema must be > defined in the program] > > xercesc_3_1::XMLPlatformUtils::Initialize(const char*,const > char*,xercesc_3_1::PanicHandler*,xercesc_3_1::MemoryManager*) library.o > xercesc_3_1::XMLUni::fgXercesSchemaFullChecking library.o > [Hint: static member xercesc_3_1::XMLUni::fgXercesSchemaFullChecking > must be defined in the program] > > xercesc_3_1::InputSource::InputSource(const unsigned > short*,xercesc_3_1::MemoryManager*) library.o > xercesc_3_1::Wrapper4InputSource::Wrapper4InputSource(xercesc_3_1::InputSource*,bool,xercesc_3_1::MemoryManager*) > library.o > xercesc_3_1::XMLUni::fgDOMWRTDiscardDefaultContent library.o > [Hint: static member > xercesc_3_1::XMLUni::fgDOMWRTDiscardDefaultContent must be defined in > the program] > > xercesc_3_1::SchemaSymbols::fgURI_XSI library.o > [Hint: static member xercesc_3_1::SchemaSymbols::fgURI_XSI must be > defined in the program] > > xercesc_3_1::XMemory::operator new(unsigned) library.o > xercesc_3_1::XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation > library.o > [Hint: static member > xercesc_3_1::XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation > must be defined in the program] > > xercesc_3_1::XMLUni::fgDOMComments library.o > [Hint: static member xercesc_3_1::XMLUni::fgDOMComments must be > defined in the program] > > xercesc_3_1::XMLUni::fgXercescDefaultLocale library.o > [Hint: static member xercesc_3_1::XMLUni::fgXercescDefaultLocale must > be defined in the program] > > xercesc_3_1::XMLUni::fgDOMValidate library.o > [Hint: static member xercesc_3_1::XMLUni::fgDOMValidate must be > defined in the program] > > xercesc_3_1::XMLUni::fgXercesSchemaExternalSchemaLocation library.o > [Hint: static member > xercesc_3_1::XMLUni::fgXercesSchemaExternalSchemaLocation must be > defined in the program] > > xercesc_3_1::Wrapper4InputSource::~Wrapper4InputSource() library.o > xercesc_3_1::XMLUni::fgDOMNamespaces library.o > [Hint: static member xercesc_3_1::XMLUni::fgDOMNamespaces must be > defined in the program] > > xercesc_3_1::SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION library.o > [Hint: static member > xercesc_3_1::SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION must be > defined in the program] > > xercesc_3_1::DOMImplementationRegistry::getDOMImplementation(const > unsigned short*) library.o > xercesc_3_1::XMLUni::fgDOMErrorHandler library.o > [Hint: static member xercesc_3_1::XMLUni::fgDOMErrorHandler must be > defined in the program] > > xercesc_3_1::InputSource::setEncoding(const unsigned short*) library.o > xercesc_3_1::XMLPlatformUtils::fgMemoryManager library.o > [Hint: static member xercesc_3_1::XMLPlatformUtils::fgMemoryManager > must be defined in the program] > > xercesc_3_1::XMLPlatformUtils::Terminate() library.o > xercesc_3_1::XMLUni::fgXercesSchema library.o > [Hint: static member xercesc_3_1::XMLUni::fgXercesSchema must be > defined in the program] > > xercesc_3_1::XMLUni::fgDOMDatatypeNormalization library.o > [Hint: static member xercesc_3_1::XMLUni::fgDOMDatatypeNormalization > must be defined in the program] > > ld: fatal: symbol referencing errors. No output written to driver linking problem. Any suggestions? Bernie On 4/6/16 8:47 AM, Boris Kolpackov wrote: > Hi Bernie, > > Wow, Sun CC in the C++11 mode. Never thought I would live to see the > day ;-) Can you try the attached patch (on libxsd) and see if it helps? > > Thanks, > Boris -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 7270 bytes Desc: S/MIME Cryptographic Signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20160406/c1c7971e/smime-0001.bin From boris at codesynthesis.com Wed Apr 6 09:57:30 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Apr 6 09:57:32 2016 Subject: [xsd-users] Error compiling char-utf8.txx with Solaris Studio 12.4 c++11 In-Reply-To: <57050BAC.9020901@nasa.gov> References: <5704F8CD.1070307@nasa.gov> <57050BAC.9020901@nasa.gov> Message-ID: Hi Bernie, Bernie Harris writes: > Undefined first referenced > symbol in file > typeinfo for xercesc_3_1::DOMLSException library.o My guess would be you've built Xerces-C++ with GCC. If that's the case, then you will need to rebuild it with Sun CC: gmake distclean ./configure CC=cc CXX=CC gmake If that doesn't help, you may also want to try to build it in the C++11 mode, who knows. Boris From Bernard.T.Harris at nasa.gov Wed Apr 6 11:00:26 2016 From: Bernard.T.Harris at nasa.gov (Bernie Harris) Date: Wed Apr 6 12:50:57 2016 Subject: [xsd-users] Error compiling char-utf8.txx with Solaris Studio 12.4 c++11 In-Reply-To: References: <5704F8CD.1070307@nasa.gov> <57050BAC.9020901@nasa.gov> Message-ID: <5705248A.4090903@nasa.gov> Xerces-C++ was originally compile with Sun CC but not with -std=c++11. When I re-configured and re-made it with c++11, gmake check fails with a bunch of core files. Using c++11 is not going to be easy. Besides the xerces and linking issues, I also ran into this > "/usr/local/xsd-4.0.0-i686-solaris/examples/../libxsd/xsd/cxx/tree/types.txx", > line 447: Error: Narrowing conversion of 'int' value to 'unsigned > char' is not allowed here. > "/usr/local/xsd-4.0.0-i686-solaris/examples/../libxsd/xsd/cxx/tree/serialization.txx", > line 721: Where: While instantiating > "xsd::cxx::tree::hex_binary xsd::cxx::tree::_type>>::encode() const". > "/usr/local/xsd-4.0.0-i686-solaris/examples/../libxsd/xsd/cxx/tree/serialization.txx", > line 721: Where: Instantiated from > xsd::cxx::tree::serializer_impl xsd::cxx::tree::simple_type xsd::cxx::tree::_type>>>(xercesc_3_1::DOMElement&, const > xsd::cxx::tree::_type&). > "/usr/local/xsd-4.0.0-i686-solaris/examples/../libxsd/xsd/cxx/tree/type-serializer-map.txx", > line 163: Where: Instantiated from > xsd::cxx::tree::type_serializer_map::type_serializer_map(). > "/usr/local/xsd-4.0.0-i686-solaris/examples/../libxsd/xsd/cxx/tree/type-serializer-map.txx", > line 507: Where: Instantiated from > xsd::cxx::tree::type_serializer_plate<0, char>::type_serializer_plate(). > "CDAS.cxx", line 17220: Where: Instantiated from non-template code. error while compiling (with -std=c++11). Note the CDAS.cxx was the output of compiling my schema file with xsd (and --std c++11). Is that another file you need to fix? Bernie On 4/6/16 9:57 AM, Boris Kolpackov wrote: > Hi Bernie, > > Bernie Harris writes: > >> Undefined first referenced >> symbol in file >> typeinfo for xercesc_3_1::DOMLSException library.o > My guess would be you've built Xerces-C++ with GCC. If that's the case, > then you will need to rebuild it with Sun CC: > > gmake distclean > ./configure CC=cc CXX=CC > gmake > > If that doesn't help, you may also want to try to build it in the C++11 > mode, who knows. > > Boris -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 7270 bytes Desc: S/MIME Cryptographic Signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20160406/5863da0c/smime.bin From boris at codesynthesis.com Thu Apr 7 11:35:07 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Apr 7 11:34:55 2016 Subject: [xsd-users] Error compiling char-utf8.txx with Solaris Studio 12.4 c++11 In-Reply-To: <5705248A.4090903@nasa.gov> References: <5704F8CD.1070307@nasa.gov> <57050BAC.9020901@nasa.gov> <5705248A.4090903@nasa.gov> Message-ID: Hi Bernie, Bernie Harris writes: > Xerces-C++ was originally compile with Sun CC but not with > -std=c++11. When I re-configured and re-made it with c++11, > gmake check > fails with a bunch of core files. Using c++11 is not going to be easy. Do you know if in Sun CC code compiled in the C++11 mode is incompatible with that compiled in C++98? Perhaps it is just the standard C++ library that is different and you could build Xerces-C++ in C++98 but with a modern library? > Is that another file you need to fix? Yes, looks like it. Do you think you could apply the casts and then send me the patch. I would hate to do it one file at a time. Thanks, Boris From Bernard.T.Harris at nasa.gov Thu Apr 7 13:16:01 2016 From: Bernard.T.Harris at nasa.gov (Bernie Harris) Date: Fri Apr 8 10:23:06 2016 Subject: [xsd-users] Error compiling char-utf8.txx with Solaris Studio 12.4 c++11 In-Reply-To: References: <5704F8CD.1070307@nasa.gov> <57050BAC.9020901@nasa.gov> <5705248A.4090903@nasa.gov> Message-ID: <570695D1.6040204@nasa.gov> On 4/7/16 11:35 AM, Boris Kolpackov wrote: > Hi Bernie, > > Bernie Harris writes: > >> Xerces-C++ was originally compile with Sun CC but not with >> -std=c++11. When I re-configured and re-made it with c++11, >> gmake check >> fails with a bunch of core files. Using c++11 is not going to be easy. > Do you know if in Sun CC code compiled in the C++11 mode is incompatible > with that compiled in C++98? Perhaps it is just the standard C++ library > that is different and you could build Xerces-C++ in C++98 but with a modern > library? According to the documentation > > > Using C++11 Features > > In Oracle Solaris Studio 12.4, the C++ compiler supports C++11, a new > language and ABI (Application Binary Interface). > > In C++ 11 mode, the CC compiler uses the g++ ABI and a version of the > g++ runtime library that is supplied with Oracle Solaris Studio. For > this release, version 4.8.2 of the g++ runtime library is used. > ... > > > Library Incompatibilities with C++11 in this Release > > With ?std=x or ?compat=g, the following ?library=v options are not > allowed: > > * > > Cstd > > * > > stlport4 > > * > > stdcxx4 > > * > > Crun > > * > > iostream > > When you need to list libraries to be linked, such as when you are > creating a shared library, use the following options in this order > when using the ?compat=g or ?std=x options: > > -lstdc++ -lgcc_s -lCrunG3 I'll need to take a closer look at building Xerces-C++ . > > >> Is that another file you need to fix? > Yes, looks like it. Do you think you could apply the casts and then > send me the patch. I would hate to do it one file at a time. I'll try but I haven't done much C++ in 15 years. I've mainly been doing Java and my C++ is really rusty. Bernie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 7270 bytes Desc: S/MIME Cryptographic Signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20160407/2be501e9/smime.bin From boris at codesynthesis.com Fri Apr 8 10:35:36 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Apr 8 10:35:24 2016 Subject: [xsd-users] Error compiling char-utf8.txx with Solaris Studio 12.4 c++11 In-Reply-To: <570695D1.6040204@nasa.gov> References: <5704F8CD.1070307@nasa.gov> <57050BAC.9020901@nasa.gov> <5705248A.4090903@nasa.gov> <570695D1.6040204@nasa.gov> Message-ID: Hi Bernie, Bernie Harris writes: > In Oracle Solaris Studio 12.4, the C++ compiler supports C++11, a > new language and ABI (Application Binary Interface). > > In C++ 11 mode, the CC compiler uses the g++ ABI and a version of > the g++ runtime library that is supplied with Oracle Solaris > Studio. For this release, version 4.8.2 of the g++ runtime library > is used. Interesting. This means you should be able to build Xerces-C++ with GCC (probably even in C++98 mode, though it should also build in C++11) and then link it to your application that is built with Sun CC in C++11 mode. > I'll try but I haven't done much C++ in 15 years. It looks like they are just casts like the ones I sent you earlier. But if you run into anything different, let me konw. Boris From Bernard.T.Harris at nasa.gov Mon Apr 11 07:05:48 2016 From: Bernard.T.Harris at nasa.gov (Bernie Harris) Date: Mon Apr 11 11:40:44 2016 Subject: [xsd-users] Error compiling char-utf8.txx with Solaris Studio 12.4 c++11 In-Reply-To: References: <5704F8CD.1070307@nasa.gov> <57050BAC.9020901@nasa.gov> <5705248A.4090903@nasa.gov> <570695D1.6040204@nasa.gov> Message-ID: <570B850C.4010901@nasa.gov> On 4/8/16 10:35 AM, Boris Kolpackov wrote: > Hi Bernie, > > Bernie Harris writes: > >> In Oracle Solaris Studio 12.4, the C++ compiler supports C++11, a >> new language and ABI (Application Binary Interface). >> >> In C++ 11 mode, the CC compiler uses the g++ ABI and a version of >> the g++ runtime library that is supplied with Oracle Solaris >> Studio. For this release, version 4.8.2 of the g++ runtime library >> is used. > Interesting. This means you should be able to build Xerces-C++ with > GCC (probably even in C++98 mode, though it should also build in C++11) > and then link it to your application that is built with Sun CC in C++11 > mode. Most, if not all of the Xerces-C++ check programs are failing by throwing an EndOfEntityException. This has been reported by others years ago (that you even commented on). There wasn't any resolution and I guess it is a problem with the g++ runtime on Solaris. Here's a stack trace: > t@1 (l@1) program terminated by signal ABRT (Abort) > 0xfd86c925: __lwp_kill+0x0015: jae __lwp_kill+0x23 [ > 0xfd86c933, .+0xe ] > Current function is xercesc_3_1::ReaderMgr::popReader > 1083 throw EndOfEntityException(prevEntity, readerNum); > (dbx) print fThrowEOE > fThrowEOE = false > (dbx) print prevReaderThrowAtEnd > prevReaderThrowAtEnd = true > (dbx) print readerNum > readerNum = 3U and the code > 1078 // > 1079 // If there was a previous entity, and either the > fThrowEOE flag is > set > 1080 // or reader was marked as such, then throw an end of entity. > 1081 // > 1082 if (prevEntity && (fThrowEOE || prevReaderThrowAtEnd)) > 1083 throw EndOfEntityException(prevEntity, readerNum); I'm giving up. I'll look for an alternative CDF Java library that doesn't have the performance limitation (single threadedness) that cause me to look at C++. If that doesn't work, I my just use simple "std::cout <<" statements to produce the XML from C++ instead of using xsd and Xerces-C++. Neither is as nice but may be less work. Thanks. Bernie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 7270 bytes Desc: S/MIME Cryptographic Signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20160411/f45f9c38/smime.bin From albert.babinskas at imagingsciences.com Thu Apr 14 14:04:49 2016 From: albert.babinskas at imagingsciences.com (Babinskas, Albert) Date: Thu Apr 14 14:05:00 2016 Subject: [xsd-users] Cannot link against polymorphic type Message-ID: <83be71a89ca4474ebcd2354b7f6d30ac@DENORASPEXCH1.sds.sybrondental.com> Hello, I have a problem where I receive a linker error against polymorphic type object. My schema compiles and I have output files, but once I try to link against them I receive linker error for polymorphic type object. My setup is this, I have a master schema.xsd which has most of my elements. Then I also import additional examoption-v1.xsd schema. Examoption-v1.xsd schema has the polymorphic elements that I cannot link against in my application. I compile examoption-v1.xsd with this command: xsd.exe cxx-tree --char-type char --char-encoding utf8 --generate-default-ctor --generate-wildcard --generate-polymorphic --polymorphic-type=examOption_t --polymorphic-type examOption --polymorphic-type-all examoption-v1.xsd I tried various combinations of -polymorphic-type, which didn't work. I compile schema.xsd with this command: xsd.exe cxx-tree --char-type char --char-encoding utf8 --generate-serialization --generate-ostream --generate-default-ctor --generate-wildcard --generate-polymorphic --polymorphic-type examOption_t --polymorphic-type-all --namespace-map http://api.ditcdev.com/schema/datawarehouse/v1.3.0-130=schema::datawarehouse schema1.xsd My exampoption-v1.xsd looks like this: My schema.xsd beginning looks like this: xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://api.ditcdev.com/schema/examoption/v1"xmlns:tns="http://api.ditcdev.com/schema/datawarehouse/v1.3.0-130" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://api.ditcdev.com/schema/datawarehouse/v1.3.0-130" version="1.0"> Now when I compile my schema.hxx does get #include "examoption-v1.hxx". When I add #include "schema.hxx" into my project I get a link error: Severity Code Description Project File Line Suppression State Error LNK2019 unresolved external symbol "public: __thiscall schema::examoption::v1::panoramic_t::panoramic_t(class xercesc_3_1::DOMElement const &,class xsd::cxx::tree::flags,class xsd::cxx::tree::_type *)" (??0panoramic_t@v1@examoption@schema@@QAE@ABVDOMElement@xercesc_3_1@@Vflags@tree@cxx@xsd@@PAV_type@789@@Z) referenced in function "class std::auto_ptr __cdecl xsd::cxx::tree::factory_impl(class xercesc_3_1::DOMElement const &,class xsd::cxx::tree::flags,class xsd::cxx::tree::_type *)" (??$factory_impl@Vpanoramic_t@v1@examoption@schema@@@tree@cxx@xsd@@YA?AV?$auto_ptr@V_type@tree@cxx@xsd@@@std@@ABVDOMElement@xercesc_3_1@@Vflags@012@PAV_type@012@@Z) What am I doing wrong? I read polymorphic section in manual. I am not sure where the problem is. -Albert From Antti.Keskinen at basware.com Fri Apr 15 06:06:50 2016 From: Antti.Keskinen at basware.com ([EXT] Antti Keskinen) Date: Fri Apr 15 08:57:10 2016 Subject: [xsd-users] Build error C2955 from unique_ptr with Visual Studio 2008 SP1 Message-ID: Hello! I am developing an application that uses a third-party module which in turn makes use of XSD-generated classes from XML schema files. The environment specifics are as follows: - Visual Studio 2008 SP1, building from the VS 2008 Command Prompt using an NMake makefile generated with CMake - XSD version is 4.0.0, downloaded only few days ago from the CodeSynthesis website - CMake version 3.5.1 The following command is used to generate the files: 'XSD "schema/conf.xsd" -root-element configuration'. The 'conf.xsd' defines a schema for the application's configuration file, and is rather simple in structure, so I believe there's no error in the validity of the schema itself. Attempting to compile the generated CXX file results in errors like the following: ...\include\xsd/cxx/xml/dom/auto-ptr.hxx(41) : error C2955: 'xsd::cxx::xml::dom::unique_ptr' : use of class template requires template argument list ...\include\xsd/cxx/xml/dom/auto-ptr.hxx(41) : see declaration of 'xsd::cxx::xml::dom::unique_ptr' ...\include\xsd/cxx/xml/dom/auto-ptr.hxx(82) : see reference to class template instantiation 'xsd::cxx::xml::dom::unique_ptr' being compiled ...\include\xsd/cxx/xml/dom/auto-ptr.hxx(41) : error C2143: syntax error : missing ',' before '<' ...\include\xsd/cxx/xml/dom/auto-ptr.hxx(44) : error C2059: syntax error : '<' ...\include\xsd/cxx/xml/dom/auto-ptr.hxx(44) : error C2238: unexpected token(s) preceding ';' ...\include\xsd/cxx/xml/dom/auto-ptr.hxx(46) : error C2653: 'base' : is not a class or namespace name ...\include\xsd/cxx/xml/dom/auto-ptr.hxx(46) : error C2146: syntax error : missing ';' before identifier 'pointer' ...\include\xsd/cxx/xml/dom/auto-ptr.hxx(46) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ...\include\xsd/cxx/xml/dom/auto-ptr.hxx(46) : error C2868: 'xsd::cxx::xml::dom::unique_ptr::pointer' : illegal syntax for using-declaration; expected qualified-name ...\include\xsd/cxx/xml/dom/auto-ptr.hxx(53) : error C2143: syntax error : missing ')' before '&&' ...\include\xsd/cxx/xml/dom/auto-ptr.hxx(53) : error C2143: syntax error : missing ';' before '&&' ...\include\xsd/cxx/xml/dom/auto-ptr.hxx(53) : error C2059: syntax error : ')' ...\include\xsd/cxx/xml/dom/auto-ptr.hxx(53) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body The list of errors goes on and on after these lines, apparently the very first error causes a cascading syntax-error effect where future lines are interpreted incorrectly. Looking at the error, it arises from the headers of the XSD itself, so to me this seems to be a problem with the syntax of the generated code. Perhaps I need to define some specific flag when building with Visual Studio 2008? I tried looking at the CodeSynthesis website, but I could not find any specific compilation flags to consider. The application I am developing is proprietary in nature, but the third-party module we are using is up for grabs in GitHub. I have managed to extract only the generated files to a stand-alone project, and compiling this file generates the same errors as when compiling as part of the build chain. This leads to the conclusion that the error can be isolated to the schema, the XSD tool and the resulting generated files, and has little or no relation to the third-party module itself. I could really use some help, or at least pointers on where to look for more information. To me, it seems that this is a compiler problem, but I am unsure on how to verify it. Regards, Antti Keskinen From boris at codesynthesis.com Fri Apr 15 12:33:06 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Apr 15 12:32:55 2016 Subject: [xsd-users] Cannot link against polymorphic type In-Reply-To: <83be71a89ca4474ebcd2354b7f6d30ac@DENORASPEXCH1.sds.sybrondental.com> References: <83be71a89ca4474ebcd2354b7f6d30ac@DENORASPEXCH1.sds.sybrondental.com> Message-ID: Hi Albert, Babinskas, Albert writes: > Now when I compile my schema.hxx does get #include "examoption-v1.hxx". > When I add #include "schema.hxx" into my project I get a link error: I am not sure what #include's have to do with linker errors. Have you added schema1.cxx, examoption-v1.cxx, and schema.cxx to your project, so that they are part of your executable? Boris From boris at codesynthesis.com Fri Apr 15 12:39:38 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Apr 15 12:39:25 2016 Subject: [xsd-users] Build error C2955 from unique_ptr with Visual Studio 2008 SP1 In-Reply-To: References: Message-ID: Hi Antti, You are getting this error because libxsd is included in the "C++11 mode" (which VS 2008 does not support). This happens when the generated code was compiled (from schema) with the --std c++11 option. Check with the author of the project what is the minimum VS version they support. Boris From albert.babinskas at imagingsciences.com Fri Apr 15 14:06:06 2016 From: albert.babinskas at imagingsciences.com (Babinskas, Albert) Date: Fri Apr 15 14:06:15 2016 Subject: [xsd-users] Cannot link against polymorphic type In-Reply-To: References: <83be71a89ca4474ebcd2354b7f6d30ac@DENORASPEXCH1.sds.sybrondental.com> Message-ID: Boris, The source files are compiled into a static library that is included in my project. -Albert -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Friday, April 15, 2016 12:33 PM To: Babinskas, Albert Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] Cannot link against polymorphic type Hi Albert, Babinskas, Albert writes: > Now when I compile my schema.hxx does get #include "examoption-v1.hxx". > When I add #include "schema.hxx" into my project I get a link error: I am not sure what #include's have to do with linker errors. Have you added schema1.cxx, examoption-v1.cxx, and schema.cxx to your project, so that they are part of your executable? Boris From Antti.Keskinen at basware.com Mon Apr 18 01:35:17 2016 From: Antti.Keskinen at basware.com ([EXT] Antti Keskinen) Date: Mon Apr 18 08:52:53 2016 Subject: [xsd-users] Build error C2955 from unique_ptr with Visual Studio 2008 SP1 In-Reply-To: References: Message-ID: Hi Boris, Thanks for your help. The author officially supports Visual Studio 2013 Express Edition on the Windows platform. However, using VS2013 is not an option for us at the moment, so I'll have to make-do. I managed to find this flag from the command-line options that are given to the XSD executable. Unlike I first thought, here's the full XSD command-line options that were used: --type-naming ucc --function-naming lcc --generate-serialization --std c++11 --output-dir ${OUTPUT} I removed the --std c++11 option, and the schema files now compile correctly. Now I still need to fix some other build errors from the non-generated source files since there are references to the unique_ptr type, and its corresponding std::move function, which again are C++11 features. But at least I'm getting forward now. Thanks for the tip! :) Regards, Antti -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: 15. huhtikuuta 2016 19:40 To: [EXT] Antti Keskinen Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] Build error C2955 from unique_ptr with Visual Studio 2008 SP1 Hi Antti, You are getting this error because libxsd is included in the "C++11 mode" (which VS 2008 does not support). This happens when the generated code was compiled (from schema) with the --std c++11 option. Check with the author of the project what is the minimum VS version they support. Boris From boris at codesynthesis.com Mon Apr 18 09:58:33 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Apr 18 09:58:42 2016 Subject: [xsd-users] Cannot link against polymorphic type In-Reply-To: References: <83be71a89ca4474ebcd2354b7f6d30ac@DENORASPEXCH1.sds.sybrondental.com> Message-ID: Hi Albert, Babinskas, Albert writes: > The source files are compiled into a static library that is included > in my project. This post explains the potential problem with static libraries and polymorphism: http://www.codesynthesis.com/pipermail/odb-users/2013-May/001286.html While this post explains how to fix it in VC++: http://www.codesynthesis.com/pipermail/odb-users/2013-May/001289.html Can you try this and see if it helps? Boris From wendy01142015 at outlook.com Wed Apr 20 13:01:35 2016 From: wendy01142015 at outlook.com (wendy f) Date: Wed Apr 20 13:01:49 2016 Subject: [xsd-users] Why see 'xercesc/util/Mutexes.cpp: No such file or directory' Message-ID: Hello all, here is the generated code: ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > EQL_Message_ (const ::MyMessage& s, const ::xml_schema::namespace_infomap& m, ::xml_schema::flags f) { ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d ( ::xsd::cxx::xml::dom::serialize< char > ( "MyMessage", "", m, f)); ::MyMessage_ (*d, s, f); return d; } when the application runs to the first line, the application crashes and report the following errors: Program received signal SIGSEGV, Segmentation fault. xercesc_3_1::XMLMutex::lock (this=0x0) at xercesc/util/Mutexes.cpp:61 61 xercesc/util/Mutexes.cpp: No such file or directory. in xercesc/util/Mutexes.cpp Currently, I am using xercesc_3.1.3. Any comment? Thank you From boris at codesynthesis.com Thu Apr 21 12:01:37 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Apr 21 12:01:46 2016 Subject: [xsd-users] Why see 'xercesc/util/Mutexes.cpp: No such file or directory' In-Reply-To: References: Message-ID: Hi wendy, wendy f writes: > ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > > EQL_Message_ (const ::MyMessage& s, > const ::xml_schema::namespace_infomap& m, > ::xml_schema::flags f) > > xercesc_3_1::XMLMutex::lock (this=0x0) at xercesc/util/Mutexes.cpp:61 If you are calling the above function directly, then this kind of error usually means you haven't initialized the Xerces-C++ runtime. See Section 3.1, "Initializing the Xerces-C++ Runtime" in the manual: http://codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#3.1 Boris