2012-05-08 56 views
0

我正在使用VS2005爲我創建的模式生成並生成Xerces .hxx/.cxx文件。我能夠生成模式並編譯它們,但是在鏈接時我收到了下面的鏈接器錯誤。我將xerces-c_3D.lib添加到Linker-> Input-> Additional Dependencies選項卡中。它似乎找到了它。因爲當我從連接器 - >一般 - >其他庫目錄VS抱怨它找不到xerces-c_3D.libXerces C++無法解析的鏈接器錯誤

我已經使用http://wiki.codesynthesis.com/Using_XSD_with_Microsoft_Visual_Studio來設置項目。

我也嘗試過構建一個示例應用程序,並在設置包含它和構建的庫之後確保無誤。我甚至在2010年構建並做了相同的事情,它的工作原理。所以我很遺憾在哪裏尋找。

任何建議表示讚賞。

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" ([email protected]@[email protected]@2QBGB) referenced in function "protected: __thiscall xsd::cxx::zc_istream_base<char>::zc_istream_base<char>(class xsd::cxx::ro_string<char> const &)" ([email protected][email protected]@[email protected]@[email protected][email protected]@[email protected]@Z) 
1>Arch.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION" ([email protected]@[email protected]@2QBGB) 
1>ArchDetails.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION" ([email protected]@[email protected]@2QBGB) 
1>ArchType.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION" ([email protected]@[email protected]@2QBGB) 
1>TSPI.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION" ([email protected]@[email protected]@2QBGB) 
1>UniqueID.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_SCHEMALOCACTION" ([email protected]@[email protected]@2QBGB) 
1>Arch.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_SCHEMALOCACTION" ([email protected]@[email protected]@2QBGB) 
1>ArchDetails.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_SCHEMALOCACTION" ([email protected]@[email protected]@2QBGB) 
1>ArchType.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_SCHEMALOCACTION" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_SCHEMALOCACTION" ([email protected]@[email protected]@2QBGB) 
1>TSPI.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgXSI_SCHEMALOCACTION" ([email protected]@[email protected]@2QBGB) 
1>UniqueID.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgURI_XSI" ([email protected]@[email protected]@2QBGB) 
1>Arch.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgURI_XSI" ([email protected]@[email protected]@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)" ([email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@@[email protected]@[email protected]@Z) 
1>ArchDetails.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgURI_XSI" ([email protected]@[email protected]@2QBGB) 
1>ArchType.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgURI_XSI" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgURI_XSI" ([email protected]@[email protected]@2QBGB) 
1>TSPI.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::SchemaSymbols::fgURI_XSI" ([email protected]@[email protected]@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 *)" ([email protected]@[email protected]@[email protected]) 
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 *)" ([email protected]@[email protected]@[email protected]) 
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 *)" ([email protected]@[email protected]@[email protected]) referenced in function "void __cdecl xsd::cxx::xml::dom::clear<char>(class xercesc_3_1::DOMElement &)" ([email protected]@[email protected]@[email protected]@@[email protected][email protected]@@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 *)" ([email protected]@[email protected]@[email protected]) 
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 *)" ([email protected]@[email protected]@[email protected]) 
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 *)" ([email protected]@[email protected]@[email protected]) 
1>UniqueID.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXMLNSURIName" ([email protected]@[email protected]@2QBGB) 
1>Arch.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXMLNSURIName" ([email protected]@[email protected]@2QBGB) 
1>ArchDetails.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXMLNSURIName" ([email protected]@[email protected]@2QBGB) 
1>ArchType.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXMLNSURIName" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXMLNSURIName" ([email protected]@[email protected]@2QBGB) 
1>TSPI.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXMLNSURIName" ([email protected]@[email protected]@2QBGB) referenced in function "public: __thiscall xsd::cxx::xml::string::~string(void)" ([email protected]@[email protected]@@[email protected]) 
1>UniqueID.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned long __cdecl xercesc_3_1::XMLString::stringLen(unsigned short const * const)" ([email protected]@[email protected]@[email protected]) 
1>Arch.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned long __cdecl xercesc_3_1::XMLString::stringLen(unsigned short const * const)" ([email protected]@[email protected]@[email protected]) 
1>ArchDetails.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static unsigned long __cdecl xercesc_3_1::XMLString::stringLen(unsigned short const * const)" ([email protected]@[email protected]@[email protected]) 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 *)" ([email protected]@[email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 
1>ArchType.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned long __cdecl xercesc_3_1::XMLString::stringLen(unsigned short const * const)" ([email protected]@[email protected]@[email protected]) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned long __cdecl xercesc_3_1::XMLString::stringLen(unsigned short const * const)" ([email protected]@[email protected]@[email protected]) 
1>TSPI.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned long __cdecl xercesc_3_1::XMLString::stringLen(unsigned short const * const)" ([email protected]@[email protected]@[email protected]) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "public: virtual unsigned short const * __thiscall xercesc_3_1::InputSource::getEncoding(void)const " ([email protected]@[email protected]@UBEPBGXZ) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "public: virtual unsigned short const * __thiscall xercesc_3_1::InputSource::getPublicId(void)const " ([email protected]@[email protected]@UBEPBGXZ) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "public: virtual unsigned short const * __thiscall xercesc_3_1::InputSource::getSystemId(void)const " ([email protected]@[email protected]@UBEPBGXZ) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall xercesc_3_1::InputSource::setEncoding(unsigned short const * const)" ([email protected]@[email protected]@[email protected]) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall xercesc_3_1::InputSource::setPublicId(unsigned short const * const)" ([email protected]@[email protected]@[email protected]) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall xercesc_3_1::InputSource::setSystemId(unsigned short const * const)" ([email protected]@[email protected]@[email protected]) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMErrorHandler" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXercesLoadSchema" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXercesSchemaExternalSchemaLocation" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXercesUserAdoptsDOMDocument" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXercesHandleMultipleImports" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXercesSchemaFullChecking" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgXercesSchema" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMValidate" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMElementContentWhitespace" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMNamespaces" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMEntities" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMDatatypeNormalization" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMComments" ([email protected]@[email protected]@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 *)" ([email protected]@[email protected]@[email protected]@[email protected]) 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)" ([email protected]@[email protected]@[email protected]@@[email protected]@[email protected]@@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@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)" ([email protected][email protected]@[email protected]@[email protected]@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 &)" ([email protected][email protected]@[email protected]@[email protected]@[email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMXMLDeclaration" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMWRTFormatPrettyPrint" ([email protected]@[email protected]@2QBGB) 
1>T6EchoTEC.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_3_1::XMLUni::fgDOMWRTDiscardDefaultContent" ([email protected]@[email protected]@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 ========== 
+0

感謝您添加的代碼標記以便閱讀。 –

+0

比較成功構建的示例應用程序與產生上述錯誤的項目設置之間的構建和鏈接設置,特別是比較任何選項中列出的庫的順序。對列出的庫重新排序可能有助於解決鏈接器停滯的符號。 – damienh

+0

這很奇怪。我將所有的XML代碼移動到一個DLL中,現在鏈接器錯誤消失了。 –

回答

2

答案很簡單,設置屬性 - > C/C++ - >語言 - >視wchar_t內建類型爲No(/ ZC:wchar_t-)

+0

我們是否需要在編譯xerces庫或我們的應用程序時設置此選項?如何在命令行 – Chandu

+0

設置此選項用於編譯您的應用程序。命令行選項可能類似於那裏的/ z命令。你必須研究它才能發現。 –

相關問題