???? ID: 154753 - ????? ???????: 03 ?????? 2010 - ??????: 4.0

??????? C ?? C++ ???????????? ?? ???? ????????? ????? ???? ?? ??? ????? C++ ?? ????? ?? ????? ???? ??? ?? ?????

?????? ??????This article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.

?? ????? ??

??? ?? ??????? ???? | ??? ?? ??????? ????

??????

?? ???? ????? ???? ?? ?? ??????? ???????????? LIBC [D] .LIB, LIBCMT [D] .LIB, LIBCI [D] .LIB, LIBCIMT [D] .LIB, LIBCP [D] .LIB, LIBCPMT [D] .LIB, MSVCRT [D] .LIB, MSVCIRT [D] .LIB, ?? ?? ???? ????????? ????? ???? ?? ??? ????? C++ ?? ????? ?? ????? ???? ??? MSVCPRT [D] .LIB.

???? ???????

?? ?? ???? ????????? ??? ????? C++, ?? (LIBC [D] .LIB, LIBCMT [D] .LIB ?? MSVCRT[D].LIB) ???? ?? ???????? ??? ??, ?? ????? ??? ?? ??????? ?????? ?? ?????? (?????-??????? <ml[d]>, multithreaded <mt[d]>, ?? multithreaded DLL <md[d]>) ??? C ?????? ???????????? ?? ?????? (?? ????) ??????? ?????? ???? C++ ????????? ??? ?? ?? ????????? ?? ?? ?????? iostream ????????? ?? ?? ???? ?? ?? ???? ???? ?? ???? ?? ????? ??? ??? ???? ??? ?? ????? ????? ?????? ?? ???, ????? ?????? ?? ????? ????:</md[d]></mt[d]></ml[d]>

?????? 1: ????? ????????? test1.cpp

// test1.cpp
void main()
{
}
				
  • ??? ?? ??????? test1.cpp ?? ????? ?? ??? ??/ML(??/ MLd, for a debug build) compiler option, your program will link with LIBC.LIB (or LIBCD.LIB, for debug build), in addition to other libraries.
    ???:The/ML, ??/MLdlibrary compiler options for static single-threaded libraries were removed in Visual C++ 2005 and in later versions of Visual C++.
  • If you build test1.cpp using the/MT(??/MTd, for a debug build) compiler option, your program will link with LIBCMT.LIB (or LIBCMTD.LIB, for debug build), in addition to other libraries.
  • If you build test1.cpp using the/MD(??/MDd, for a debug build)compiler option, your program will link with MSVCRT.LIB (or MSVCRTD.LIB, for debug build), in addition to other libraries. In this case, your program will be dependent on MSVCRT.DLL (or MSVCRTD.DLL for debug build).

Case 2: Sample program test2.cpp

   // test2.cpp
   #include <iostream>
   void main()
   {
   }
				
  • If you build test2.cpp using the/ML(??/MLd, for a debug build) compiler option, your program will link with LIBC.LIB (or LIBCD.LIB, for debug build) and LIBCP.LIB (or LIBCPD.LIB, for debug build), in addition to other libraries.
    ???:The/ML, ??/MLd?????-??????? ??????? ????????? ?? ??? ????????? ??????? ?????? ????? C++ 2005 ?? ????? C++ ?? ??? ?? ????????? ??? ?????? ?? ???
  • ??? ?? ??????? test2.cpp ?? ????? ?? ??? ??/MT(??/ MTd?? ???? ??????? ???? ?? ???) ??????? ??????, ???? ????????? ????? ???? LIBCMT.LIB (?? ???? ??????? ???? ?? ???, LIBCMTD.LIB) ?? ??? ?? LIBCPMT.LIB (?? ???? ??????? ???? ?? ???, LIBCPMTD.LIB), ???? ???????????? ?? ??????
  • ??? ?? ??????? test2.cpp ?? ????? ?? ??? ??/MD(??/ MDd?? ???? ??????? ???? ?? ???) ??????? ??????, ???? ????????? ????? ???? MSVCRT.LIB (?? ???? ??????? ???? ?? ???, MSVCRTD.LIB) ?? ??? ?? MSVCPRT.LIB (?? ???? ??????? ???? ?? ???, MSVCPRTD.LIB), ???? ???????????? ?? ??????
    C++ 2008 ????? ??? Microsoft, ?? ??? ???? ????????? MSVCR90.DLL MSVCP90.DLL (?? MSVCR90D.DLL ?? ???? ??????? ???? ?? ??? MSVCP90D.DLL) ?? ?????? ?? ??????
    Microsoft Visual C++ 2005, ?? ??? ???? ????????? MSVCR80.DLL MSVCP80.DLL (?? MSVCR80D.DLL ?? ???? ??????? ???? ?? ??? MSVCP80D.DLL) ?? ?????? ?? ??????
    Microsoft Visual C++ 2003, ?? ??? ???? ????????? MSVCR71.DLL MSVCP71.DLL (?? MSVCR71D.DLL ?? ???? ??????? ???? ?? ??? MSVCP71D.DLL) ?? ?????? ?? ??????
    Microsoft Visual C++ 2002, ?? ??? ???? ????????? MSVCR70.DLL MSVCP70.DLL (?? MSVCR70D.DLL ?? ???? ??????? ???? ?? ??? MSVCP70D.DLL) ?? ?????? ?? ??????
    C++ 6.0 ????? ??? Microsoft, ?? ??? ???? ????????? MSVCRT.DLL MSVCP60.DLL (?? MSVCRTD.DLL ?? ???? ??????? ???? ?? ??? MSVCP60D.DLL) ?? ?????? ?? ??????
    Microsoft Visual C++ 5.0, ?? ??? ???? ????????? MSVCRT.DLL MSVCP50.DLL (?? MSVCRTD.DLL ?? ???? ??????? ???? ?? ??? MSVCP50D.DLL) ?? ?????? ?? ??????
    C++ 4.2 ????? ??? Microsoft, ?? ??? ???? ????????? MSVCRT.DLL (?? ???? ??????? ???? ?? ??? MSVCRTD.DLL) ?? ?????? ???? ?? MSVCPRT.LIB (?? ???? ??????? ???? ?? ???, MSVCPRTD.LIB)?

?????? 3: ????? ????????? test3.cpp

???:.H ????????? ??????? ????? ??? ??????? (<useoldio.h>????? ??) deprecated ????? C++ 2002 ??? ???? ??? ?? ?? ????? C++ 2005 ?? ????? C++ 2003 ??? ?????? ?? ???? ??? ?????, ????? ????? ????? C++ ?? ???? ??????? ????? C++ 2002 ?? ??? ??? ??? ???? ?????? </useoldio.h>
// test3.cpp
#include <iostream.h>
void main()
{
}
				
  • ??? ?? ??????? test3.cpp ?? ????? ?? ??? ??/ML(??/ MLd, for a debug build) compiler option, your program will link with LIBC.LIB (or LIBCD.LIB, for debug build) and LIBCI.LIB (or LIBCID.LIB, for debug build), in addition to other libraries.
    ???:The/ML, ??/MLdlibrary compiler options for static single-threaded libraries were removed in Visual C++ 2005 and in later versions of Visual C++.
  • If you build test3.cpp using the/MT(??/MTd, for a debug build) compiler option, your program will link with LIBCMT.LIB (or LIBCMTD.LIB, for debug build) and LIBCIMT.LIB (or LIBCIMTD.LIB, for debug build), in addition to other libraries.
  • If you build test3.cpp using the/MD(??/MDd?? ???? ??????? ???? ?? ???) ??????? ??????, ???? ????????? ????? ???? MSVCRT.LIB (?? ???? ??????? ???? ?? ???, MSVCRTD.LIB) ?? ??? ?? MSVCIRT.LIB (?? ???? ??????? ???? ?? ???, MSVCIRTD.LIB) ???? ???????????? ?? ?????? ?? ?????? ???, ???? ????????? ???? MSVCRT.DLL (?? ???? ??????? ???? ?? ??? MSVCRTD.DLL) ?? ?????? ?? MSVCIRT.DLL (?? ???? ??????? ???? ?? ??? MSVCIRTD.DLL)?
????? ??? ?? ???????? ?? ?? ???? C++ ????????????, ?????? iostream ????????????, ?? ?? ?? ???? ???? ?????? ??????? ?????? (/ML [d],/MT [d],/MD [d]) ???????? ??? ?? ???? ???? ?? ??? ?????-???????, multithreaded ?? multithreaded ???????????? ?? ??? ??????? DLL ?? ?? ?????????

???:?? ?? ????? ??? .h ????????? ???? ???? C++ ????? ??? ??? ?? .h ????????? ?? ??? ????? ??? ??? C ?????? ????? ??? ?? ?????? iostream ????? ??? ?????? ?? ???? ??? ?? ??? ???? ??? ????, ??????? explained ?? ??? ??? <useoldio.h>?? <use_ansi.h>????????? ????????? ???? ??? ???? ????? ?? ????????.</use_ansi.h></useoldio.h>

?????? ???, ?? ????? ??? ??????? ???, <useoldio.h>?? <use_ansi.h>, ?? #pragmas ??? ??? #Pragmas ?????? iostream ????????? ?? ???? C++ ????????? ?? ???????? ??? ?? ??? ?? ???? ???? ???? ?? ??? ????? ????? </use_ansi.h></useoldio.h>

????? ??? ???? <useoldio.h>??? #pragma ?????, ?? ?????? iostream ????????? ??? ???? ???? ?? ??? ????? ???? ??? ?????? iostream ????? <useoldio.h>????? ??? ?? ?????, ??? ?? ???? ????????? ??? ???? ?? ?????? iostream ????? ??? ????? ???, ?????? iostream ????????? ???? ???? ????? ???????? ??? ??? ????? ?????? ??????? ??? ????? ??? ??????? ????? ??? ?? <useoldio.h>.</useoldio.h></useoldio.h></useoldio.h>

?????? iostream ????? ???

?? ?????? ?? ??????? ?????? ?????? ?? ??????? ????
FSTREAM.HIOMANIP.H
IOS.HIOSTREAM.H
ISTREAM.HOSTREAM.H
STDIOSTR.HSTREAMB.H
STRSTREA.H
???: <useoldio.h>????? C++ .NET 2003 ?? ????? ????????? ?? ??? ???? ???? ???? ??? ?????? iostream ????????? ????? C++ 2003 ?? ??? ?? ?????????, ?? ????? ???? ??? ??????? <useoldio.h>????? ??? ?? ?????? ??? ??.</useoldio.h></useoldio.h>
????? ??? ???? <use_ansi.h>???? C++ ????????? ??? ???? ???? ?? ??? ????? #pragma ????? ??? ??? ??? ???? C++ ???????? <use_ansi.h>????? ??? ?? ????? ??? ?? ???? ????????? ??? ???? ?? ???? C++ ????? ??? ????? ???, ?? ???? C++ ????????? ???? ???? ????? ???????? ??? ??? ????? ?????? ??????? ??? ????? ??? ??????? ????? ??? ?? <use_ansi.h>.</use_ansi.h></use_ansi.h></use_ansi.h>

???? C++ ????? ???

?? ?????? ?? ??????? ?????? ?????? ?? ??????? ????
?????????BITSET??????DEQUE
FSTREAM?????IOMANIPIOS
IOSFWDIOSTREAMISTREAMITERATOR
????????????????????
??????????????OSTREAM??????
setSSTREAM?????STDEXCEPT
STREAMBUF????????STRSTREAMTYPEINFO
??????VALARRAYVECTORXIOSBASE
XLOCALEXLOCINFOXLOCMONXLOCNUM
XLOCTIMEXMEMORYXSTRINGXTREE
XUTILITYYMATH.H
?? ?????? iostream ????????? ?? ?? ???? C++ ????????? ????? C++ 4.2 ??? ??? ???? ???? ?? ?????
?? ?????? ?? ??????? ?????? ?????? ?? ??????? ????
?????? ?????? ????????????? ?? ??? ???? ????
/ML (VC ++ .NET 2003 ?? ?????)LIBC.LIB, LIBCP.LIB
/ MLd (VC ++ .NET 2003 ?? ?????)LIBCD.LIB, LIBCPD.LIB
/MTLIBCMT.LIB, LIBCPMT.LIB
/ MTdLIBCMTD.LIB, LIBCPMTD.LIB
/MDMSVCRT.LIB, MSVCPRT.LIB
/ MDdMSVCRTD.LIB, MSVCPRTD.LIB

CRT DLL ????? ?? ??? ?????? ??????

?? ?????? ?? ??????? ?????? ?????? ?? ??????? ????
???? ????????? ?? ??? ???? ????DLL (????? C++ 5.0|6.0) ????? ????DLL (????? C++ .NET 2002|Visual C++ .NET 2003) ????? ????DLL ????? (????? C++ 2005|Visual C++ 2008
MSVCRT.LIBMSVCRT.DLLMSVCR7 (0|1). dllMSVCR (80|90). dll
MSVCRTD.LIBMSVCRTD.DLLMSVCR7 (0|1) D.DLL(80|90) D.DLL MSVCR
MSVCPRT.LIB(5|6) MSVCP 0.DLLMSVCP7 (0|1). dllMSVCP (80|90). dll
MSVCPRTD.LIB(5|6) MSVCP 0D.DLLMSVCP7 (0|1) D.DLL(80|90) D.DLL MSVCP
MSVCIRT.LIBMSVCIRT.DLL
MSVCIRTD.LIBMSVCIRTD.DLL

??????

C ??-???? ???????????
HTTP://MSDN.Microsoft.com/en-us/library/abx4dbyh.aspx (http://msdn.microsoft.com/en-us/library/abx4dbyh.aspx) ???????? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????::
154419  (http://support.microsoft.com/kb/154419/ ) ???? C++ ????????? ??????? ??????

???? ???? ???? ??:
  • Microsoft Visual C++ 2008 Express Edition
  • Microsoft Visual C++ 2005 Express Edition
  • Microsoft Visual C++ .NET 2003 Standard Edition
  • Microsoft Visual C++ .NET 2002 Standard Edition
  • Microsoft Visual C++ 5.0 Professional Edition
  • Microsoft Visual C++ 5.0 Enterprise Edition
  • Microsoft Visual C++ 4.2 Enterprise Edition
??????: 
kbarttypeinf kbcompiler kbinfo kblangcpp kbmt KB154753 KbMthi
???? ?????? ???????????? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:154753  (http://support.microsoft.com/kb/154753/en-us/ )