質問

I'm using VS2005 to generate and build Xerces .hxx/.cxx files for a schema I created. I'm able to generate the schemas and compile them but upon linking I received the below linker errors. I included xerces-c_3D.lib into the Linker->Input->Additional Dependencies tab. And it seems to find it. Because when I take out the location from Linker->General->Additional Library Directories VS complains that it can't find xerces-c_3D.lib

I've used http://wiki.codesynthesis.com/Using_XSD_with_Microsoft_Visual_Studio to setup the project.

I've also tried building one of the example applications and after setting up the includes and libraries it builds without fail. I even built and did the same thing in vs 2010 and it works. So I'm at a loss as to where to look.

Any suggestions are appreciated.

1>------ Build started: Project: ProjectBlue, Configuration: Debug Win32 ------
1>Linking...
1>UniqueID.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION" (__imp_?fgXSI_NONAMESPACESCHEMALOCACTION@SchemaSymbols@xercesc_3_1@@2QBGB) referenced in function "protected: __thiscall xsd::cxx::zc_istream_base<char>::zc_istream_base<char>(class xsd::cxx::ro_string<char> const &)" (??0?$zc_istream_base@D@cxx@xsd@@IAE@ABV?$ro_string@D@12@@Z)
1>Arch.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION" (__imp_?fgXSI_NONAMESPACESCHEMALOCACTION@SchemaSymbols@xercesc_3_1@@2QBGB)
1>ArchDetails.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION" (__imp_?fgXSI_NONAMESPACESCHEMALOCACTION@SchemaSymbols@xercesc_3_1@@2QBGB)
1>ArchType.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION" (__imp_?fgXSI_NONAMESPACESCHEMALOCACTION@SchemaSymbols@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION" (__imp_?fgXSI_NONAMESPACESCHEMALOCACTION@SchemaSymbols@xercesc_3_1@@2QBGB)
1>TSPI.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION" (__imp_?fgXSI_NONAMESPACESCHEMALOCACTION@SchemaSymbols@xercesc_3_1@@2QBGB)
1>UniqueID.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_SCHEMALOCACTION" (__imp_?fgXSI_SCHEMALOCACTION@SchemaSymbols@xercesc_3_1@@2QBGB)
1>Arch.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_SCHEMALOCACTION" (__imp_?fgXSI_SCHEMALOCACTION@SchemaSymbols@xercesc_3_1@@2QBGB)
1>ArchDetails.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_SCHEMALOCACTION" (__imp_?fgXSI_SCHEMALOCACTION@SchemaSymbols@xercesc_3_1@@2QBGB)
1>ArchType.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_SCHEMALOCACTION" (__imp_?fgXSI_SCHEMALOCACTION@SchemaSymbols@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_SCHEMALOCACTION" (__imp_?fgXSI_SCHEMALOCACTION@SchemaSymbols@xercesc_3_1@@2QBGB)
1>TSPI.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_SCHEMALOCACTION" (__imp_?fgXSI_SCHEMALOCACTION@SchemaSymbols@xercesc_3_1@@2QBGB)
1>UniqueID.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgURI_XSI" (__imp_?fgURI_XSI@SchemaSymbols@xercesc_3_1@@2QBGB)
1>Arch.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgURI_XSI" (__imp_?fgURI_XSI@SchemaSymbols@xercesc_3_1@@2QBGB) referenced in function "public: class std::_Vector_const_iterator<class xercesc_3_1::DOMAttr *,class std::allocator<class xercesc_3_1::DOMAttr *> > & __thiscall std::_Vector_const_iterator<class xercesc_3_1::DOMAttr *,class std::allocator<class xercesc_3_1::DOMAttr *> >::operator+=(int)" (??Y?$_Vector_const_iterator@PAVDOMAttr@xercesc_3_1@@V?$allocator@PAVDOMAttr@xercesc_3_1@@@std@@@std@@QAEAAV01@H@Z)
1>ArchDetails.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgURI_XSI" (__imp_?fgURI_XSI@SchemaSymbols@xercesc_3_1@@2QBGB)
1>ArchType.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgURI_XSI" (__imp_?fgURI_XSI@SchemaSymbols@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgURI_XSI" (__imp_?fgURI_XSI@SchemaSymbols@xercesc_3_1@@2QBGB)
1>TSPI.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgURI_XSI" (__imp_?fgURI_XSI@SchemaSymbols@xercesc_3_1@@2QBGB)
1>UniqueID.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static bool __cdecl xercesc_3_1::XMLString::equals(unsigned short const *,unsigned short const *)" (__imp_?equals@XMLString@xercesc_3_1@@SA_NPBG0@Z)
1>Arch.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static bool __cdecl xercesc_3_1::XMLString::equals(unsigned short const *,unsigned short const *)" (__imp_?equals@XMLString@xercesc_3_1@@SA_NPBG0@Z)
1>ArchDetails.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static bool __cdecl xercesc_3_1::XMLString::equals(unsigned short const *,unsigned short const *)" (__imp_?equals@XMLString@xercesc_3_1@@SA_NPBG0@Z) referenced in function "void __cdecl xsd::cxx::xml::dom::clear<char>(class xercesc_3_1::DOMElement &)" (??$clear@D@dom@xml@cxx@xsd@@YAXAAVDOMElement@xercesc_3_1@@@Z)
1>ArchType.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static bool __cdecl xercesc_3_1::XMLString::equals(unsigned short const *,unsigned short const *)" (__imp_?equals@XMLString@xercesc_3_1@@SA_NPBG0@Z)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static bool __cdecl xercesc_3_1::XMLString::equals(unsigned short const *,unsigned short const *)" (__imp_?equals@XMLString@xercesc_3_1@@SA_NPBG0@Z)
1>TSPI.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static bool __cdecl xercesc_3_1::XMLString::equals(unsigned short const *,unsigned short const *)" (__imp_?equals@XMLString@xercesc_3_1@@SA_NPBG0@Z)
1>UniqueID.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXMLNSURIName" (__imp_?fgXMLNSURIName@XMLUni@xercesc_3_1@@2QBGB)
1>Arch.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXMLNSURIName" (__imp_?fgXMLNSURIName@XMLUni@xercesc_3_1@@2QBGB)
1>ArchDetails.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXMLNSURIName" (__imp_?fgXMLNSURIName@XMLUni@xercesc_3_1@@2QBGB)
1>ArchType.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXMLNSURIName" (__imp_?fgXMLNSURIName@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXMLNSURIName" (__imp_?fgXMLNSURIName@XMLUni@xercesc_3_1@@2QBGB)
1>TSPI.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXMLNSURIName" (__imp_?fgXMLNSURIName@XMLUni@xercesc_3_1@@2QBGB) referenced in function "public: __thiscall xsd::cxx::xml::string::~string(void)" (??1string@xml@cxx@xsd@@QAE@XZ)
1>UniqueID.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned long __cdecl xercesc_3_1::XMLString::stringLen(unsigned short const * const)" (__imp_?stringLen@XMLString@xercesc_3_1@@SAKQBG@Z)
1>Arch.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned long __cdecl xercesc_3_1::XMLString::stringLen(unsigned short const * const)" (__imp_?stringLen@XMLString@xercesc_3_1@@SAKQBG@Z)
1>ArchDetails.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static unsigned long __cdecl xercesc_3_1::XMLString::stringLen(unsigned short const * const)" (__imp_?stringLen@XMLString@xercesc_3_1@@SAKQBG@Z) referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl xsd::cxx::xml::transcode<char>(unsigned short const *)" (??$transcode@D@xml@cxx@xsd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBG@Z)
1>ArchType.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned long __cdecl xercesc_3_1::XMLString::stringLen(unsigned short const * const)" (__imp_?stringLen@XMLString@xercesc_3_1@@SAKQBG@Z)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned long __cdecl xercesc_3_1::XMLString::stringLen(unsigned short const * const)" (__imp_?stringLen@XMLString@xercesc_3_1@@SAKQBG@Z)
1>TSPI.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned long __cdecl xercesc_3_1::XMLString::stringLen(unsigned short const * const)" (__imp_?stringLen@XMLString@xercesc_3_1@@SAKQBG@Z)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "public: virtual unsigned short const * __thiscall xercesc_3_1::InputSource::getEncoding(void)const " (?getEncoding@InputSource@xercesc_3_1@@UBEPBGXZ)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "public: virtual unsigned short const * __thiscall xercesc_3_1::InputSource::getPublicId(void)const " (?getPublicId@InputSource@xercesc_3_1@@UBEPBGXZ)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "public: virtual unsigned short const * __thiscall xercesc_3_1::InputSource::getSystemId(void)const " (?getSystemId@InputSource@xercesc_3_1@@UBEPBGXZ)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall xercesc_3_1::InputSource::setEncoding(unsigned short const * const)" (?setEncoding@InputSource@xercesc_3_1@@UAEXQBG@Z)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall xercesc_3_1::InputSource::setPublicId(unsigned short const * const)" (?setPublicId@InputSource@xercesc_3_1@@UAEXQBG@Z)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall xercesc_3_1::InputSource::setSystemId(unsigned short const * const)" (?setSystemId@InputSource@xercesc_3_1@@UAEXQBG@Z)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMErrorHandler" (__imp_?fgDOMErrorHandler@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXercesLoadSchema" (__imp_?fgXercesLoadSchema@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation" (__imp_?fgXercesSchemaExternalNoNameSpaceSchemaLocation@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXercesSchemaExternalSchemaLocation" (__imp_?fgXercesSchemaExternalSchemaLocation@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXercesUserAdoptsDOMDocument" (__imp_?fgXercesUserAdoptsDOMDocument@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXercesHandleMultipleImports" (__imp_?fgXercesHandleMultipleImports@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXercesSchemaFullChecking" (__imp_?fgXercesSchemaFullChecking@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXercesSchema" (__imp_?fgXercesSchema@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMValidate" (__imp_?fgDOMValidate@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMElementContentWhitespace" (__imp_?fgDOMElementContentWhitespace@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMNamespaces" (__imp_?fgDOMNamespaces@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMEntities" (__imp_?fgDOMEntities@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMDatatypeNormalization" (__imp_?fgDOMDatatypeNormalization@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMComments" (__imp_?fgDOMComments@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class xercesc_3_1::DOMImplementation * __cdecl xercesc_3_1::DOMImplementationRegistry::getDOMImplementation(unsigned short const *)" (__imp_?getDOMImplementation@DOMImplementationRegistry@xercesc_3_1@@SAPAVDOMImplementation@2@PBG@Z) referenced in function "struct xsd::cxx::xml::dom::auto_ptr<class xercesc_3_1::DOMDocument> __cdecl xsd::cxx::xml::dom::parse<char>(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class xercesc_3_1::DOMErrorHandler &,class xsd::cxx::xml::properties<char> const &,unsigned long)" (??$parse@D@dom@xml@cxx@xsd@@YA?AU?$auto_ptr@VDOMDocument@xercesc_3_1@@@0123@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAVDOMErrorHandler@xercesc_3_1@@ABV?$properties@D@123@K@Z)
1>T6EchoTEC.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: __thiscall xercesc_3_1::InputSource::InputSource(unsigned short const * const,class xercesc_3_1::MemoryManager * const)" (__imp_??0InputSource@xercesc_3_1@@IAE@QBGQAVMemoryManager@1@@Z) referenced in function "public: __thiscall xsd::cxx::xml::sax::std_input_source::std_input_source<char>(class std::basic_istream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$?0D@std_input_source@sax@xml@cxx@xsd@@QAE@AAV?$basic_istream@DU?$char_traits@D@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@6@@Z)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMXMLDeclaration" (__imp_?fgDOMXMLDeclaration@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMWRTFormatPrettyPrint" (__imp_?fgDOMWRTFormatPrettyPrint@XMLUni@xercesc_3_1@@2QBGB)
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMWRTDiscardDefaultContent" (__imp_?fgDOMWRTDiscardDefaultContent@XMLUni@xercesc_3_1@@2QBGB)
1>C:\Users\MCA\Documents\Visual Studio 2010\Projects\ProjectAlpha\ProjectBlue_2005\Debug\ProjectBlue.exe : fatal error LNK1120: 31 unresolved externals
1>Build log was saved at "file://C:\Users\MCA\Documents\Visual Studio 2010\Projects\ProjectAlpha\ProjectBlue_2005\Debug\BuildLog.htm"
1>ProjectBlue - 62 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
役に立ちましたか?

解決

The simple answer is to set Properties->C/C++->Language->Treat WChar_t As Built in Type to No(/Zc:wchar_t-)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top