2012-05-01 95 views
2

我正在使用ANTLR和Visual Studio 2011測試版,並且我在編譯過程中遇到以下錯誤...:/ 我重新編譯了antlr.lib,我嘗試了所有...也許? 我ANTLR 2.7.5還測試...Antlr和鏈接失敗

antlr.lib(TokenRefCount.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(TokenRefCount.obj) : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification 
antlr.lib(BitSet.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(RecognitionException.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(MismatchedCharException.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(CharBuffer.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(CharScanner.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(NoViableAltForCharException.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(Token.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(ASTRefCount.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(BaseAST.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(TokenBuffer.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(MismatchedTokenException.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(ASTFactory.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(Parser.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(LLkParser.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(NoViableAltException.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(CommonAST.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(String.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(InputBuffer.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
antlr.lib(CommonToken.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in tard_lexer.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" ([email protected]@@[email protected]) already defined in libcpmtd.lib(stdthrow.obj) 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::_Container_base12(void)" ([email protected]@@[email protected]) already defined in tard_lexer.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::~_Container_base12(void)" ([email protected]@@[email protected]) already defined in tard_lexer.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: void __thiscall std::_Container_base12::_Orphan_all(void)" ([email protected][email protected]@@QAEXXZ) already defined in tard_lexer.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "void __cdecl std::_Xbad_alloc(void)" ([email protected]@@YAXXZ) already defined in libcpmtd.lib(xthrow.obj) 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "void __cdecl std::_Xlength_error(char const *)" ([email protected]@@[email protected]) already defined in libcpmtd.lib(xthrow.obj) 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "void __cdecl std::_Xout_of_range(char const *)" ([email protected]@@[email protected]) already defined in libcpmtd.lib(xthrow.obj) 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __thiscall std::locale::id::id(unsigned int)" ([email protected]@[email protected]@[email protected]@Z) already defined in tard_lexer.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "char const * __cdecl std::_Syserror_map(int)" ([email protected]@@[email protected]) already defined in libcpmtd.lib(syserror.obj) 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "char const * __cdecl std::_Winerror_map(int)" ([email protected]@@[email protected]) already defined in libcpmtd.lib(syserror.obj) 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" ([email protected]@@[email protected]@Z) already defined in libcpmtd.lib(xlock.obj) 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" ([email protected]@@[email protected]) already defined in libcpmtd.lib(xlock.obj) 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: struct std::_Iterator_base12 * * __thiscall std::_Container_base12::_Getpfirst(void)const " ([email protected][email protected]@@[email protected]@XZ) already defined in tard_lexer.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "bool __cdecl std::uncaught_exception(void)" ([email protected]@@YA_NXZ) already defined in libcpmtd.lib(uncaught.obj) 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: bool __thiscall std::ios_base::good(void)const " ([email protected][email protected]@@QBE_NXZ) already defined in tard_parser.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: int __thiscall std::ios_base::flags(void)const " ([email protected][email protected]@@QBEHXZ) already defined in tard_parser.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __int64 __thiscall std::ios_base::width(void)const " ([email protected][email protected]@@QBE_JXZ) already defined in tard_parser.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __int64 __thiscall std::ios_base::width(__int64)" ([email protected][email protected]@@[email protected]) already defined in tard_parser.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in tard_parser.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __int64 __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,__int64)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in tard_parser.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in tard_parser.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::tie(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected][email protected]@[email protected]@@[email protected]) already defined in tard_parser.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: class std::basic_streambuf<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::rdbuf(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected][email protected]@[email protected]@@[email protected]) already defined in tard_parser.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: char __thiscall std::basic_ios<char,struct std::char_traits<char> >::fill(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@QBEDXZ) already defined in tard_parser.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@QAEXXZ) already defined in tard_parser.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > & (__cdecl*)(class std::basic_ostream<char,struct std::char_traits<char> > &))" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]@[email protected]@[email protected]) already defined in tard_parser.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(int)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]@Z) already defined in tard_parser.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in tard_parser.obj 
msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::endl(class std::basic_ostream<char,struct std::char_traits<char> > &)" ([email protected]@@[email protected][email protected]@[email protected]@@[email protected]@@Z) already defined in tard_parser.obj 
MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _memmove already defined in LIBCMTD.lib(memmove.obj) 
MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj) 
MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __CrtDbgReportW already defined in LIBCMTD.lib(dbgrptw.obj) 
MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _tolower already defined in LIBCMTD.lib(tolower.obj) 
MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj) 
MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _isprint already defined in LIBCMTD.lib(_ctype.obj) 
MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" ([email protected]@[email protected]@@Z) already defined in LIBCMTD.lib(typinfo.obj) 
MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" ([email protected]@[email protected]@@Z) already defined in LIBCMTD.lib(typinfo.obj) 
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library 
../../dist/debug\test_vc_7_1.exe : fatal error LNK1169: one or more multiply defined symbols found 

回答

0

什麼是您的項目運行庫? 我想你包含一些默認庫,這些庫不應該在你的運行時選項中使用。只需按照this article中提到的設置庫和運行時選項,並根據表忽略其餘部分。