- 浏览: 21005 次
- 性别:
- 来自: 新乡
最近访客 更多访客>>
文章分类
- 全部博客 (24)
- WIDE JAVA (2)
- SHARE JAVA (1)
- DAY JAVA (2)
- ERROR JAVA (1)
- ENGLISH JAVA (0)
- OSA JAVA (0)
- CORE JAVA (0)
- BOOK JAVA (0)
- TEMP JAVA (0)
- WIDE DELPHI (0)
- SHARE DELPHI (0)
- DAY DELPHI (2)
- ERROR DELPHI (0)
- ENGLISH DELPHI (1)
- OSA DELPHI (0)
- CORE DELPHI (0)
- TEMP DELPHI (0)
- BOOK DELPHI (0)
- SHARE CPP (1)
- TEMP CPP (1)
- BOOK CPP (2)
- PS (0)
- LINUX (1)
- WINDOWS (0)
- THE ART OF ALGORITHM (1)
- ENGLISH CPP (4)
- DAY CPP (3)
- PROBLEMS (1)
- ENGLISH (1)
- 黑马程序员Heima (0)
- Help Yourself (0)
最新评论
C Run-Time Libraries
Visual Studio 2010 Other Versions Visual Studio 2008 Visual Studio 2005 Visual Studio .NET 2003
This topic discusses the various .lib files that comprise the C run-time libraries as well as their associated compiler options and preprocessor directives.
C Run-Time Libraries (CRT)
--------------------------------------------------------------------------------
The following libraries contain the C run-time library functions.
C run-time library (without iostream or standard C++ library)
Associated DLL
Characteristics
Option
Preprocessor directives
libcmt.lib
None, static link.
Multithreaded, static link
/MT
_MT
msvcrt.lib
msvcr100.dll
Multithreaded, dynamic link (import library for MSVCR100.DLL). Be aware that if you use the Standard C++ Library, your program will need MSVCP100.DLL to run.
/MD
_MT, _DLL
libcmtd.lib
None, static link
Multithreaded, static link (debug)
/MTd
_DEBUG, _MT
msvcrtd.lib
msvcr100d.dll
Multithreaded, dynamic link (import library for MSVCR100D.DLL) (debug).
/MDd
_DEBUG, _MT, _DLL
msvcmrt.lib
None, static link
C Runtime static library. Used for mixed managed/native code.
/clr
/clr:oldSyntax
msvcurt.lib
None, static link
C Runtime static library compiled as 100% pure MSIL code. All code complies with the ECMA URT spec for MSIL.
/clr:pure
Note
The single-threaded CRT (libc.lib, libcd.lib) (formerly the /ML or /MLd options) is no longer available. Instead, use the multithreaded CRT. See Multithreaded Libraries Performance.
If you link your program from the command line without a compiler option that specifies a C run-time library, the linker will use LIBCMT.LIB. This is different from previous versions of Visual C++ which used LIBC.LIB, the single-threaded library, instead.
Using the statically linked CRT implies that any state information saved by the C runtime library will be local to that instance of the CRT. For example, if you use strtok, _strtok_l, wcstok, _wcstok_l, _mbstok, _mbstok_l when using a statically linked CRT, the position of the strtok parser is unrelated to the strtok state used in code in the same process (but in a different DLL or EXE) that is linked to another instance of the static CRT. In contrast, the dynamically linked CRT shares state for all code within a process that is dynamically linked to the CRT. This concern does not apply if you use the new more secure versions of these functions; for example, strtok_s does not have this problem.
Because a DLL built by linking to a static CRT will have its own CRT state, it is not recommended to link statically to the CRT in a DLL unless the consequences of this are specifically desired and understood. For example, if you call _set_se_translator in an executable that loads the DLL linked to its own static CRT, any hardware exceptions generated by the code in the DLL will not be caught by the translator, but hardware exceptions generated by code in the main executable will be caught.
If you are using the /clr compiler switch, your code will be linked with a static library, msvcmrt.lib. The static library provides a proxy between your managed code and the native CRT. You cannot use the statically linked CRT ( /MT or /MTd options) with /clr. Use the dynamically-linked libraries (/MD or /MDd) instead.
If you are using the /clr:pure compiler switch, your code will be linked with the static library msvcurt.lib. As with /clr, you cannot link with the statically linked library.
For more information on using the CRT with /clr, see Mixed (Native and Managed) Assemblies; for /clr:pure, see Pure and Verifiable Code (C++/CLI).
To build a debug version of your application, the _DEBUG flag must be defined and the application must be linked with a debug version of one of these libraries. For more information about using the debug versions of the library files, see CRT Debugging Techniques.
This version of Visual C++ is not conformant with the C99 standard.
Standard C++ Library
--------------------------------------------------------------------------------
Standard C++ Library
Characteristics
Option
Preprocessor directives
LIBCPMT.LIB
Multithreaded, static link
/MT
_MT
MSVCPRT.LIB
Multithreaded, dynamic link (import library for MSVCP100.dll)
/MD
_MT, _DLL
LIBCPMTD.LIB
Multithreaded, static link
/MTd
_DEBUG, _MT
MSVCPRTD.LIB
Multithreaded, dynamic link (import library for MSVCP100D.DLL)
/MDd
_DEBUG, _MT, _DLL
Note LIBCP.LIB and LIBCPD.LIB (via the old /ML and /MLd options) have been removed. Use LIBCPMT.LIB and LIBCPMTD.LIB instead via the /MT and /MTd options.
When you build a release version of your project, one of the basic C run-time libraries (LIBCMT.LIB, MSVCMRT.LIB, MSVCRT.LIB) is linked by default, depending on the compiler option you choose (multithreaded, DLL, /clr). If you include one of the Header Files in your code, a Standard C++ Library will be linked in automatically by Visual C++ at compile time. For example:
otherCopy
#include <ios>
What is the difference between msvcrt.dll and msvcr100.dll?
--------------------------------------------------------------------------------
The msvcrt.dll is now a "known DLL," meaning that it is a system component owned and built by Windows. It is intended for future use only by system-level components.
What problems exist if an application uses both msvcrt.dll and msvcr100.dll?
--------------------------------------------------------------------------------
If you have a .lib or .obj file that needs to link to msvcrt.lib, then you should not have to recompile it to work with the new msvcrt.lib in Visual C++ 2010. The .lib or .obj file may rely on the sizes, field offsets, or member function names of various CRT classes or variables, and those should all still exist in a compatible way. When you relink against msvcrt.lib, your final EXE and DLL image will now have a dependency on msvcr100.dll instead of msvcrt.dll.
If you have more than one DLL or EXE, then you may have more than one CRT, whether or not you are using different versions of Visual C++. For example, statically linking the CRT into multiple DLLs can present the same problem. Developers encountering this problem with static CRTs have been instructed to compile with /MD to use the CRT DLL. Now that the CRT DLL has been renamed to msvcr100.dll, applications may have some components linked to msvcrt.dll and others to msvcr100.dll. If your DLLs pass CRT resources across the msvcrt.dll and msvcr100.dll boundary, you will encounter issues with mismatched CRTs and need to recompile your project with Visual C++ 2010.
If your program is using more than one version of the CRT, some care is needed when passing certain CRT objects (such as file handles, locales and environment variables) across DLL boundaries. For more information on the issues involved and how to resolve them, see Potential Errors Passing CRT Objects Across DLL Boundaries.
See Also
--------------------------------------------------------------------------------
Other Resources
Run-Time Library Reference
Visual Studio 2010 Other Versions Visual Studio 2008 Visual Studio 2005 Visual Studio .NET 2003
This topic discusses the various .lib files that comprise the C run-time libraries as well as their associated compiler options and preprocessor directives.
C Run-Time Libraries (CRT)
--------------------------------------------------------------------------------
The following libraries contain the C run-time library functions.
C run-time library (without iostream or standard C++ library)
Associated DLL
Characteristics
Option
Preprocessor directives
libcmt.lib
None, static link.
Multithreaded, static link
/MT
_MT
msvcrt.lib
msvcr100.dll
Multithreaded, dynamic link (import library for MSVCR100.DLL). Be aware that if you use the Standard C++ Library, your program will need MSVCP100.DLL to run.
/MD
_MT, _DLL
libcmtd.lib
None, static link
Multithreaded, static link (debug)
/MTd
_DEBUG, _MT
msvcrtd.lib
msvcr100d.dll
Multithreaded, dynamic link (import library for MSVCR100D.DLL) (debug).
/MDd
_DEBUG, _MT, _DLL
msvcmrt.lib
None, static link
C Runtime static library. Used for mixed managed/native code.
/clr
/clr:oldSyntax
msvcurt.lib
None, static link
C Runtime static library compiled as 100% pure MSIL code. All code complies with the ECMA URT spec for MSIL.
/clr:pure
Note
The single-threaded CRT (libc.lib, libcd.lib) (formerly the /ML or /MLd options) is no longer available. Instead, use the multithreaded CRT. See Multithreaded Libraries Performance.
If you link your program from the command line without a compiler option that specifies a C run-time library, the linker will use LIBCMT.LIB. This is different from previous versions of Visual C++ which used LIBC.LIB, the single-threaded library, instead.
Using the statically linked CRT implies that any state information saved by the C runtime library will be local to that instance of the CRT. For example, if you use strtok, _strtok_l, wcstok, _wcstok_l, _mbstok, _mbstok_l when using a statically linked CRT, the position of the strtok parser is unrelated to the strtok state used in code in the same process (but in a different DLL or EXE) that is linked to another instance of the static CRT. In contrast, the dynamically linked CRT shares state for all code within a process that is dynamically linked to the CRT. This concern does not apply if you use the new more secure versions of these functions; for example, strtok_s does not have this problem.
Because a DLL built by linking to a static CRT will have its own CRT state, it is not recommended to link statically to the CRT in a DLL unless the consequences of this are specifically desired and understood. For example, if you call _set_se_translator in an executable that loads the DLL linked to its own static CRT, any hardware exceptions generated by the code in the DLL will not be caught by the translator, but hardware exceptions generated by code in the main executable will be caught.
If you are using the /clr compiler switch, your code will be linked with a static library, msvcmrt.lib. The static library provides a proxy between your managed code and the native CRT. You cannot use the statically linked CRT ( /MT or /MTd options) with /clr. Use the dynamically-linked libraries (/MD or /MDd) instead.
If you are using the /clr:pure compiler switch, your code will be linked with the static library msvcurt.lib. As with /clr, you cannot link with the statically linked library.
For more information on using the CRT with /clr, see Mixed (Native and Managed) Assemblies; for /clr:pure, see Pure and Verifiable Code (C++/CLI).
To build a debug version of your application, the _DEBUG flag must be defined and the application must be linked with a debug version of one of these libraries. For more information about using the debug versions of the library files, see CRT Debugging Techniques.
This version of Visual C++ is not conformant with the C99 standard.
Standard C++ Library
--------------------------------------------------------------------------------
Standard C++ Library
Characteristics
Option
Preprocessor directives
LIBCPMT.LIB
Multithreaded, static link
/MT
_MT
MSVCPRT.LIB
Multithreaded, dynamic link (import library for MSVCP100.dll)
/MD
_MT, _DLL
LIBCPMTD.LIB
Multithreaded, static link
/MTd
_DEBUG, _MT
MSVCPRTD.LIB
Multithreaded, dynamic link (import library for MSVCP100D.DLL)
/MDd
_DEBUG, _MT, _DLL
Note LIBCP.LIB and LIBCPD.LIB (via the old /ML and /MLd options) have been removed. Use LIBCPMT.LIB and LIBCPMTD.LIB instead via the /MT and /MTd options.
When you build a release version of your project, one of the basic C run-time libraries (LIBCMT.LIB, MSVCMRT.LIB, MSVCRT.LIB) is linked by default, depending on the compiler option you choose (multithreaded, DLL, /clr). If you include one of the Header Files in your code, a Standard C++ Library will be linked in automatically by Visual C++ at compile time. For example:
otherCopy
#include <ios>
What is the difference between msvcrt.dll and msvcr100.dll?
--------------------------------------------------------------------------------
The msvcrt.dll is now a "known DLL," meaning that it is a system component owned and built by Windows. It is intended for future use only by system-level components.
What problems exist if an application uses both msvcrt.dll and msvcr100.dll?
--------------------------------------------------------------------------------
If you have a .lib or .obj file that needs to link to msvcrt.lib, then you should not have to recompile it to work with the new msvcrt.lib in Visual C++ 2010. The .lib or .obj file may rely on the sizes, field offsets, or member function names of various CRT classes or variables, and those should all still exist in a compatible way. When you relink against msvcrt.lib, your final EXE and DLL image will now have a dependency on msvcr100.dll instead of msvcrt.dll.
If you have more than one DLL or EXE, then you may have more than one CRT, whether or not you are using different versions of Visual C++. For example, statically linking the CRT into multiple DLLs can present the same problem. Developers encountering this problem with static CRTs have been instructed to compile with /MD to use the CRT DLL. Now that the CRT DLL has been renamed to msvcr100.dll, applications may have some components linked to msvcrt.dll and others to msvcr100.dll. If your DLLs pass CRT resources across the msvcrt.dll and msvcr100.dll boundary, you will encounter issues with mismatched CRTs and need to recompile your project with Visual C++ 2010.
If your program is using more than one version of the CRT, some care is needed when passing certain CRT objects (such as file handles, locales and environment variables) across DLL boundaries. For more information on the issues involved and how to resolve them, see Potential Errors Passing CRT Objects Across DLL Boundaries.
See Also
--------------------------------------------------------------------------------
Other Resources
Run-Time Library Reference
相关推荐
The new iostream functions, as well as many other new functions, exist in the Standard C++ libraries: LIBCP.LIB, LIBCPMT.LIB, and MSVCPRT.LIB.
在编程过程中,尤其是在使用C或C++语言时,我们经常需要链接到系统库来实现特定功能,例如线程处理。当遇到"/usr/bin/ld: cannot find -lThreads"这样的错误提示时,这意味着链接器找不到指定的线程库。本文将深入...
Visual C++ 4.2 now ships a complete C++ Standard Run-time Library. The Hewlett Packard STL has been superseded with it....run-time libraries, please see InfoViewer for more information on how to use it.
With this book, Christopher Kormanyos delivers a highly practical guide to programming real-time embedded microcontroller systems in C++. It is divided into three parts plus several appendices. Part I...
First, we'll run you through the basics of C#, as well as object-oriented programming, before taking a quick tour through the latest features of C# 7 such as tuples, pattern matching, out variables, ...
If you already know the basics of Node.js, now is the time to discover how to bring it to production level by leveraging its vast ecosystem of packages.With this book, you'll work with a varied ...
Use external libraries to save time and effort Boost app performance by using the Android NDK and Renderscript Design apps for performance, responsiveness, and seamlessness Send data between devices ...
Compile-time polymorphism with templates and run-time polymorphism with virtual classes Advanced expressions, statements, and functions Smart pointers, data structures, dates and times, numerics, and ...
创建一个以从客户端收集设备信息。... Includes third party fingerprinting libraries该站点和随附的库均使用纯(ES6)Javascript编写。 前端应用程序使用React,Redux和Redux-sagas(异步操作),并通过Webpack
- 准时:on time - 迟到:be late - 过桥:cross the bridge - 乘出租车:take a taxi 2. **单词变形**: - people (复数):people(people本身就是复数形式) - brush(单三):brushes - tooth (复数):...
GNU C Library: Shared libraries 同时作为一个虚包由这些包填实: libc6-udeb dep: libc6.1 (>= 2.7-1) [alpha, ia64] GNU C Library: Shared libraries 同时作为一个虚包由这些包填实: libc6.1-udeb dep: ...
common-lisp-libraries.readthedocs.io 如果有任何不准确、歧义或建议,请。 请参阅的,而不是下面的工作链接的markdown版本。介绍Common Lisp 文档——库或 HyperSpec——并不特别“现代”或“有吸引力”。 虽然...
..\vcpkg.exe export freetype --zip The following packages are already built and ...To use the exported libraries in CMake projects use: "-DCMAKE_TOOLCHAIN_FILE=[...]/scripts/buildsystems/vcpkg.cmake
设lib为C:\codeblocks-20.03\wxWidgets\lib 在settings->compiler->Linker settings->Link libraries中点击add,选中C:\codeblocks-20.03\wxWidgets\lib\gcc_dll目录里所有文件,在Search directories->Compiler中...
### CSR Bluelab开发文档——Guide to BlueLab Libraries #### 1. 引言 CSR Bluelab开发文档《Guide to BlueLab Libraries》是CSR公司为开发者提供的详细指南,旨在帮助用户更好地理解和应用Bluelab库。该文档覆盖...
Jade and Handlebars template engines, Stylus and LESS CSS languages, OAuth and Everyauth libraries, and the Socket.IO and Derby libraries, and everything in between. The book also covers how to ...
Group : Development/Libraries Source RPM : ncurses-5.7-2.20090207.fc11.src.rpm Size : 1.71 MB Packager : Fedora Project Summary : Development files for the ncurses library Description : The ...