Visual C++ Runtime Libraries
While playing with Boost I recently ran into a bunch of library mismatch errors. Knowing which files do what helps immensely and, while I’m using VS 2008, the best summary I found was from an MSDN article on Microsoft Visual C++ 4.2.
Library types and related compiler switches | Basic C runtime library | Standard C++ Library | Old iostream library |
---|---|---|---|
Single Threaded (ML) | LIBC.LIB | LIBCP.LIB | LIBCI.LIB |
Multithreaded (MT) | LIBCMT.LIB | LIBCPMT.LIB | LIBCIMT.LIB |
Multithreaded DLL version (MD) | MSVCRT.LIB (import library for MSVCRT.DLL) | MSVCPRT.LIB* (also uses MSVCRT.DLL) | MSVCIRT.LIB (import library for MSVCIRT.DLL) |
Debug Single Threaded (MLd) | LIBCD.LIB | LIBCPD.LIB | LIBCID.LIB |
Debug Multithreaded (MTd) | LIBCMTD.LIB | LIBCPMTD.LIB | LIBCIMTD.LIB |
Debug Multithreaded DLL (MDd) | MSVCRTD.LIB (import library for MSVCRTD.DLL) | MSVCPRTD.LIB * (also uses MSVCRTD.DLL) | MSVCIRTD.LIB (import library for MSVCIRTD.DLL) |
MSVCPRT.LIB and MSVCPRTD.LIB are static libraries and do not have any DLLs related with them directly. These libraries are also dependent on MSVCRT.DLL and MSVCRTD.DLL, respectively. Any applications that use MSVCPRT.LIB or MSVCPRTD.LIB and use the “Ignore Default Library” (/NOD or NODEFAULTLIB) option, must link MSVCPRT.LIB(or MSVCPRTD.LIB) and MSVCRT.LIB (or MSVCRTD.LIB ), otherwise linker errors (such as LNK2001: unresolved externals in MSVCPRT.LIB or MSVCPRTD.LIB) will be produced.
Categories: Uncategorized
Recent Comments