Article ID: 154419
Article Last Modified on 6/4/2005
|--------------------------------|---------------------------|
| Library types and | Basic C Runtime |
| related compiler switches | library |
|--------------------------------|---------------------------|
| Single-threaded (ML) | LIBC.lib |
| Multithreaded (MT) | LIBCMT.lib |
| Multithreaded DLL version (MD) | MSVCRT.lib (import |
| | library for |
| | MSVCRT.dll) |
| Debug single-threaded (MLd) | LIBCD.lib |
| Debug multithreaded (MTd) | LIBCMTD.lib |
| Debug multithreaded DLL (MDd) | MSVCRTD.lib (import |
| | library for |
| | MSVCRTD.dll) |
|------------------------------------------------------------|
|--------------------------------|---------------------------|
| Library types and | Standard C++ |
| related compiler switches | library |
|--------------------------------|---------------------------|
| Single-threaded (ML) | LIBCP.lib |
| Multithreaded (MT) | LIBCPMT.lib |
| Multithreaded DLL version (MD) | MSVCPRT.lib*(Also uses |
| | MSVCRT.dll) |
| Debug single-threaded (MLd) | LIBCPD.lib |
| Debug multithreaded (MTd) | LIBCPMTD.lib |
| Debug multithreaded DLL (MDd) | MSVCPRTD.lib* (Also |
| | uses MSVCRTD.dll) |
|------------------------------------------------------------|
* NOTE: MSVCPRT.lib and MSVCPRTD.lib are static libraries and do not have
any dynamic link libraries (DLLs) directly related to them. These libraries are
also dependent on MSVCRT.dll and MSVCRTD.dll, respectively. If you have any
applications that use MSVCPRT.lib or MSVCPRTD.lib and you use the "Ignore
Default Library" (/NOD or NODEFAULTLIB) option, be sure to link MSVCPRT.lib (or
MSVCPRTD.lib) and MSVCRT.lib (or MSVCRTD.lib) with your application. Otherwise,
you will get linker errors (LNK2001: unresolved externals in MSVCPRT.lib or
MSVCPRTD.lib) when linking your application.)
|--------------------------------|---------------------------|
| Library types and | Old iostream |
| related compiler switches | library |
|--------------------------------|---------------------------|
| Single-threaded (ML) | LIBCI.lib |
| Multithreaded (MT) | LIBCIMT.lib |
| Multithreaded DLL version (MD) | MSVCIRT.lib (import |
| | library for |
| | MSVCIRT.dll) |
| Debug single-threaded (MLd) | LIBCID.lib |
| Debug multithreaded (MTd) | LIBCIMTD.lib |
| Debug multithreaded DLL (MDd) | MSVCIRTD.lib (import |
| | library for |
| | MSVCIRTD.dll) |
|------------------------------------------------------------|
In Visual C++ 5.0 and later, there are certain default libraries
that your program will link with. When you build a release version of your
project, one of the basic C-Runtime Libraries (LIBC.lib, LIBCMT.lib, or
MSVCRT.lib) is linked by default, depending on the compiler option you choose
(single-threaded <ML[d]>, multithreaded <MT[d]>, or
DLL<ML[d]>). Depending on the headers you use in your code, a library
from the Standard C++ library or one from the old iostream library may also be
linked.
|-------------------------|
| Old iostream headers |
|-------------------------|
| |
| FSTREAM.H | IOMANIP.H |
| IOS.H | IOSTREAM.H |
| ISTREAM.H | OSTREAM.H |
| STDIOSTR.H | STREAMB.H |
| STRSTREA.H | |
|-------------------------|
The header file <use_ansi.h> contains #pragma statements
that force the Standard C++ library to be linked in. All Standard C++ headers
include <use_ansi.h>: if you include any Standard C++ header in your
application, the Standard C++ library will be linked by default.
|-------------------------------------------------|
| Standard C++ Headers |
|-------------------------------------------------|
| ALGORITHM | BITSET | COMPLEX | DEQUE |
| EXCEPTION | FSTREAM | FUNCTIONAL | IOMANIP |
| IOS | IOSFWD | IOSTREAM | ISTREAM |
| ITERATOR | LIMITS | LIST | LOCALE |
| MAP | MEMORY | NUMERIC | OSTREAM |
| QUEUE | SET | SSTREAM | STACK |
| STDEXCEPT | STREAMBUF | STRING | STRSTREAM |
| TYPEINFO | UTILITY | VALARRAY | VECTOR |
|-------------------------------------------------|
You cannot mix calls to the old iostream library and the new
Standard C++ library.using namespace std;in the beginning of your program or to qualify each Standard C++ library identifier with namespace std, for example, std::cout.
|-------------------------|
| Old iostream Headers |
|-------------------------|
| FSTREAM.H | IOMANIP.H |
| IOS.H | IOSTREAM.H |
| ISTREAM.H | OSTREAM.H |
| STDIOSTR.H | STREAMB.H |
| STRSTREA.H | |
|-------------------------|
|-------------------------------------------------|
| Standard C++ Headers |
|-------------------------------------------------|
| ALGORITHM | BITSET | COMPLEX | DEQUE |
| EXCEPTION | FSTREAM | FUNCTIONAL | IOMANIP |
| IOS | IOSFWD | IOSTREAM | ISTREAM |
| ITERATOR | LIMITS | LIST | LOCALE |
| MAP | MEMORY | NUMERIC | OSTREAM |
| QUEUE | SET | SSTREAM | STACK |
| STDEXCEPT | STREAMBUF | STRING | STRSTREAM |
| TYPEINFO | UTILITY | VALARRAY | VECTOR |
|-------------------------------------------------|
back to the top
vector<int, allocator<int>>iV;The problem is caused by the consecutive ">>" at the end of the declaration. The solution is to put a space between two characters, so the construct becomes:
vector<int, allocator<int> > iV;This is consistent with the proposed ANSII specification.
Additional query words: STL STL.H allocator vector deque list map multimap set multiset queue stack priority_queue
Keywords: kbinfo kbfaq KB154419