九色国产,午夜在线视频,新黄色网址,九九色综合,天天做夜夜做久久做狠狠,天天躁夜夜躁狠狠躁2021a,久久不卡一区二区三区

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
VC運(yùn)行庫(kù)版本不同導(dǎo)致鏈接.LIB靜態(tài)庫(kù)時(shí)發(fā)生重復(fù)定義問(wèn)題的一個(gè)案例分析和總結(jié)


    C Runtime Library

    開(kāi)關(guān)

    對(duì)應(yīng)的庫(kù)

    版本

    /MD

    MSVCRT.LIB

    多線程DLLRelease版本

    /MDd

    MSVCRTD.LIB

    多線程DLLDebug版本

    /MT

    LIBCMT.LIB

    多線程靜態(tài)鏈接的Release版本

    /MTd

    LIBCMTD.LIB

    多線程靜態(tài)鏈接的Debug版本

    /clr

    MSVCMRT.LIB

    托管代碼和非托管代碼混合

    /clr:pure

    MSVCURT.LIB

    純托管代碼

     

    C++ Standard Library

    開(kāi)關(guān)

    對(duì)應(yīng)的庫(kù)

    版本

    /MD

    MSVCPRT.LIB

    多線程DLLRelease版本

    /MDd

    MSVCPRTD.LIB

    多線程DLLDebug版本

    /MT

    LIBCPMT.LIB

    多線程靜態(tài)鏈接的Release版本

    /MTd

    LIBCPMTD.LIB

    多線程靜態(tài)鏈接的Debug版本

     

    編譯器會(huì)自動(dòng)根據(jù)編譯選項(xiàng),選擇對(duì)應(yīng)的LIB文件。一般情況下這不會(huì)出現(xiàn)問(wèn)題。

    然而,在部分情況下,一旦你的程序的各個(gè)部分(LIB, OBJ…)并非由相同的編譯選項(xiàng)編譯出,而Link在一起的話,會(huì)出現(xiàn)各種各樣的看似很難解決的問(wèn)題,這類(lèi)問(wèn)題主要以重復(fù)定義的錯(cuò)誤形式存在,通常的解決方法也很簡(jiǎn)單,就是選擇同樣的編譯選項(xiàng)進(jìn)行編譯之后再Link。

    Case Study

    之前剛下載了ANTLR,在準(zhǔn)備編譯它的Example的時(shí)候發(fā)現(xiàn)了下面的Build錯(cuò)誤(我自己為這個(gè)例子創(chuàng)建了VS的項(xiàng)目,當(dāng)前配置為動(dòng)態(tài)鏈接Runtime庫(kù),Debug版):

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::replace(unsigned int,unsigned int,char const *,unsigned int)" (?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IIPBDI@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::reserve(unsigned int)" (?reserve@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXI@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::length(void)const " (?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator+=(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: char const & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator[](unsigned int)const " (??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(char const *)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::operator+<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@0@Z) already defined in antlr.lib(MismatchedCharException.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "bool __cdecl std::operator<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$?MDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.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> > &))" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.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)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.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> > &)" (?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: int __thiscall std::ios_base::width(int)" (?width@ios_base@std@@QAEHH@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,int)" (?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: static bool __cdecl std::char_traits<char>::eq_int_type(int const &,int const &)" (?eq_int_type@?$char_traits@D@std@@SA_NABH0@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: static int __cdecl std::char_traits<char>::eof(void)" (?eof@?$char_traits@D@std@@SAHXZ) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.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 " (?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: char __thiscall std::basic_ios<char,struct std::char_traits<char> >::fill(void)const " (?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: int __thiscall std::ios_base::flags(void)const " (?flags@ios_base@std@@QBEHXZ) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: int __thiscall std::ios_base::width(void)const " (?width@ios_base@std@@QBEHXZ) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: static unsigned int __cdecl std::char_traits<char>::length(char const *)" (?length@?$char_traits@D@std@@SAIPBD@Z) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.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)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.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 " (?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: bool __thiscall std::ios_base::good(void)const " (?good@ios_base@std@@QBE_NXZ) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Unlock(void)" (?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in antlr.lib(CharScanner.obj)

    1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z) already defined in antlr.lib(LLkParser.obj)

    1>libcpmt.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ) already defined in msvcprtd.lib(MSVCP80D.dll)

    1>libcpmt.lib(locale0.obj) : error LNK2005: "private: static void __cdecl std::locale::facet::facet_Register(class std::locale::facet *)" (?facet_Register@facet@locale@std@@CAXPAV123@@Z) already defined in msvcprtd.lib(MSVCP80D.dll)

    1>libcpmt.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)" (?_Locinfo_dtor@_Locinfo@std@@SAXPAV12@@Z) already defined in msvcprtd.lib(MSVCP80D.dll)

    1>libcpmt.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)" (?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@PBD@Z) already defined in msvcprtd.lib(MSVCP80D.dll)

    1>libcpmt.lib(xmutex.obj) : error LNK2005: "public: void __thiscall std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) already defined in msvcprtd.lib(MSVCP80D.dll)

    1>libcpmt.lib(xmutex.obj) : error LNK2005: "public: void __thiscall std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ) already defined in msvcprtd.lib(MSVCP80D.dll)

    1>libcpmt.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in msvcprtd.lib(MSVCP80D.dll)

    1>libcpmt.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in msvcprtd.lib(MSVCP80D.dll)

    1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(tolower.obj) : error LNK2005: _tolower already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(lconv.obj) : error LNK2005: _localeconv already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRTD.lib(cinitexe.obj)

    1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRTD.lib(cinitexe.obj)

    1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRTD.lib(cinitexe.obj)

    1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRTD.lib(cinitexe.obj)

    1>LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(crt0.obj) : error LNK2005: _mainCRTStartup already defined in MSVCRTD.lib(crtexe.obj)

    1>LIBCMT.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>LIBCMT.lib(_ctype.obj) : error LNK2005: _isprint already defined in MSVCRTD.lib(MSVCR80D.dll)

    1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __stricmp already defined in LIBCMT.lib(stricmp.obj)

    1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library

    1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

    1>D:\home\doc\Visual Studio 2005\Projects\tst_antlr_3\Debug\tst_antlr_3.exe : fatal error LNK1169: one or more multiply defined symbols found

    分析一下錯(cuò)誤來(lái)源,會(huì)發(fā)現(xiàn):

    1.     錯(cuò)誤來(lái)源主要是重復(fù)定義的問(wèn)題,而且重復(fù)定義的基本上都是VC RuntimeStandard C++ Library中的函數(shù)

    2.     LIBCMTLIBCPMTRelease下的Lib,本來(lái)不應(yīng)該出現(xiàn)在Debug版本的鏈接的Lib

    3.     重復(fù)定義的問(wèn)題主要出現(xiàn)在:LIBCMT, LIBCPMT, MSVCPRTD, MSVCRTD

    來(lái)看看出問(wèn)題的LIB是那些:

    1.     LIBCMTC Runtime庫(kù)的多線程靜態(tài)鏈接的Release版本

    2.     LIBCPMTC++ Standard Library的多線程靜態(tài)鏈接的Release版本

    3.     MSVCPRTDC++ Standard Library的多線程DLLDebug版本

    4.     MSVCRTDC Runtime Library的多線程DLLDebug版本

    當(dāng)前我們的配置是多線程DLLDebug版,因此34是應(yīng)該出現(xiàn)在link的列表中的,不屬于多余。而后兩者則是只是當(dāng)多線程靜態(tài)鏈接Release版中才會(huì)出現(xiàn)。這提示我在項(xiàng)目中加入的ANTLR.LIB可能是造成這個(gè)問(wèn)題的根源,因?yàn)殪o態(tài)庫(kù)的編譯選項(xiàng)很容易和主程序發(fā)生沖突,并且根據(jù)實(shí)際信息我們可以看出ANTLR.LIB應(yīng)該是用多線程靜態(tài)鏈接的Release版本來(lái)編譯的。

    這樣,解決方法就很清楚了:

    1.     切換到Release,因?yàn)?/span>ANTLR.LIB是在Release下面編譯的

    2.     Run Time庫(kù)的版本修改成多線程靜態(tài)鏈接

    做了這兩個(gè)修改之后編譯通過(guò)。

    還有一種方法是,自己用多線程DLLDebug版重新編譯一次ANTLR,生成一個(gè)新的ANTLRD.LIB,再link這個(gè)Lib也可以解決這個(gè)問(wèn)題。

    Summary

    1.     知道各個(gè)不同的LIB代表的版本信息非常重要,可以幫助快速定位問(wèn)題

    2.     在編程的時(shí)候,一定要把所有的項(xiàng)目的編譯選項(xiàng)(是靜態(tài)鏈接Runtime庫(kù)還是動(dòng)態(tài)鏈接Runtime庫(kù),Debug/Release)配置成一樣的。如果部分LIB/OBJ是由第三方提供(OBJ情況很少見(jiàn)),一般情況下只能調(diào)整自己的編譯選項(xiàng),除非你可以要求第三方提供其他版本的編譯好的LIB

    3.     在發(fā)布可重用的靜態(tài)LIB庫(kù)供其他人調(diào)用的時(shí)候,最好對(duì)應(yīng)不同的編譯選項(xiàng),乃至VC版本,提供不同版本的LIBVC自己的Runtime就是最好的例子。


    本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
    打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
    猜你喜歡
    類(lèi)似文章
    vc++6.0 編譯JRTPLIB
    鏈接錯(cuò)誤:msvcprtd.lib(MSVCP90D.dll) : error LNK2005
    error LNK2019: 無(wú)法解析的外部符號(hào)
    c – 流操作符重載問(wèn)題
    error LNK2005:error LNK2001
    Windows Mobile 上常見(jiàn)的 DirectShow 鏈接錯(cuò)誤
    更多類(lèi)似文章 >>
    生活服務(wù)
    熱點(diǎn)新聞
    分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
    綁定賬號(hào)成功
    后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
    如果VIP功能使用有故障,
    可點(diǎn)擊這里聯(lián)系客服!

    聯(lián)系客服