這是一個非常簡單的程序(一些簡單的計算,「給的東西,得到的東西),我使用Visual Studio 8.0 SP2編譯成一個lib文件。 lib文件應該被鏈接到另一個程序中,問題是另一個程序在具有Visual Studio 6.0的計算機上
當編譯程序並鏈接到lib文件(使用VS 6.0)時出現以下錯誤和警告發生:
首先一些警告:
Linking...
myLib.lib(SeController.o) : warning LNK4044: unrecognized option "manifestdependency:type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'"; ignored
myLib.lib(SeController.o) : warning LNK4044: unrecognized option "manifestdependency:type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'"; ignored
myLib.lib(SeController.o) : warning LNK4044: unrecognized option "alternatename:[email protected][email protected]@@@[email protected]@[email protected]@[email protected]@[email protected]@@YAPBDXZ"; ignored
myLib.lib(SeController.o) : warning LNK4078: multiple ".CRT" sections found with different attributes (40300040)
myLib.lib(bt_errors.o) : warning LNK4044: unrecognized option "manifestdependency:type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'"; ignored
myLib.lib(bt_errors.o) : warning LNK4044: unrecognized option "manifestdependency:type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'"; ignored
myLib.lib(SCtrlImpl.o) : warning LNK4044: unrecognized option "manifestdependency:type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'"; ignored
myLib.lib(SCtrlImpl.o) : warning LNK4044: unrecognized option "manifestdependency:type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'"; ignored
....(只是這裏的一些警告。有相同類型的hunders)
然後(部分)的錯誤:
msvcprt.lib(MSVCP60.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 *)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z) already defined in libcpd.lib(locale0.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: virtual __thiscall std::basic_ostream<char,struct std::char_traits<char> >::~basic_ostream<char,struct std::char_traits<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]Z) alread
y defined in libcpd.lib(iostream.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: virtual __thiscall std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct std::char_traits<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in
libcpd.lib(iostream.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: virtual __thiscall std::basic_istream<char,struct std::char_traits<char> >::~basic_istream<char,struct std::char_traits<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]) alread
y defined in libcpd.lib(iostream.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: __thiscall std::basic_istream<char,struct std::char_traits<char> >::basic_istream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (??0?$
[email protected][email protected]@[email protected]@@[email protected]@[email protected][email protected][email protected]@[email protected]@@[email protected][email protected]) already defined in libcpd.lib(iostream.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: virtual __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::~basic_streambuf<char,struct std::char_traits<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected])
already defined in libcpd.lib(iostream.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: "protected: __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::basic_streambuf<char,struct std::char_traits<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]) alread
y defined in libcpd.lib(iostream.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _vsprintf already defined in libcd.lib(vsprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _exit already defined in libcd.lib(crt0dat.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _atoi already defined in libcd.lib(atox.obj)
我試圖爲VS 8.0下載Visual Studio 2005的Redistrubate包有6.0 computering,但我得到了相同的錯誤和警告。
它甚至有可能從8.0與6.0編譯器在一個lib文件鏈接?
它不是改變安裝的版本的選項。 (並且不問爲什麼有人正在使用VS 6.0 :))