C运行时库(C Run-Time Libraries)

本文涉及的产品
文档翻译,文档翻译 1千页
图片翻译,图片翻译 100张
文本翻译,文本翻译 100万字符
简介: C运行时库(C Run-Time Libraries)

我的程序必定会使用C/C++的系统函数,我们可以使用静态库的方式(/MT)使用这些函数,也可以使用动态库的方式(/MD)使用这些函数。MT,链接时需要LIBCMT.libMD,链接时需要MSVCRT.lib ,运行时需要 MSVCR80.DLL

各种 C 运行时库的区别

1 )静态链接的单线程库

静态链接的单线程库只能用于单线程的应用程序, C 运行时库的目标代码最终被编译在应用程序的二进制文件中。通过 /ML 编译选项可以设置 Visual C++ 使用静态链接的单线程库。

2 )静态链接的多线程库

静态链接的多线程库的目标代码也最终被编译在应用程序的二进制文件中,但是它可以在多线程程序中使用。通过 /MT 编译选项可以设置 Visual C++ 使用静态链接的多线程库。

3 )动态链接的运行时库

动态链接的运行时库将所有的 C 库函数保存在一个单独的动态链接库 MSVCRTxx.DLL 中, MSVCRTxx.DLL 处理了多线程问题。使用 /MD 编译选项可以设置 Visual C++ 使用动态

多线程(/MT) 多线程调试(/MTd) 多线程 DLL (/MD) 多线程调试 DLL (/MDd)

C 运行时库

库文件

Single thread(static link) ML 

libc.lib

Debug single thread(static link) MLd

libcd.lib

MultiThread(static link) MT

libcmt.lib

Debug multiThread(static link) MTd

libcmtd.lib

MultiThread(dynamic link) MD

msvert.lib

Debug multiThread(dynamic link) MDd

msvertd.lib 

 

                                                                             

VS2005配置运行时库

7177ac77d4f7abd820f4ffd1a4da5de5_20160603210617603.png

如果出错#error :  Please use the /MD switch for _AFXDLL builds ,请先配置常规。

8caad39ee53b6cd03b48726b0ecda3e6_20160603210628360.png


相关文章
|
5月前
|
Java Maven
Error executing CMake: Cannot run program “cmake“
Error executing CMake: Cannot run program “cmake“
43 0
|
5月前
|
测试技术 iOS开发 Perl
废弃第三方库导致的library not found for -lXXXXX(linker command failed ) 完美解决方法
废弃第三方库导致的library not found for -lXXXXX(linker command failed ) 完美解决方法
41 0
|
Ubuntu PyTorch 算法框架/工具
Python程序运行,“libgcc_s.so.1 must be installed for pthread_cancel to work”解决办法
Python程序运行,“libgcc_s.so.1 must be installed for pthread_cancel to work”解决办法
236 0
|
5月前
|
Go C语言
安装go-sqlite3包时报exec: "gcc": executable file not found in %PATH%解决办法
安装go-sqlite3包时报exec: "gcc": executable file not found in %PATH%解决办法
226 0
|
12月前
|
JavaScript
dyld: Library not loaded:解决办法
dyld: Library not loaded:解决办法
437 1
|
5月前
解决运行qmake:Project ERROR: Cannot run compiler ‘cl‘. Output:
解决运行qmake:Project ERROR: Cannot run compiler ‘cl‘. Output:
566 0
|
11月前
|
Linux
linux运行protoc出现错误 while loading shared libraries: libprotoc.so.19
linux运行protoc出现错误 while loading shared libraries: libprotoc.so.19
120 0
如何解决:./real.exe: error while loading shared libraries: libhdf5hl_fortran.so.100: cannot open shared
如何解决:./real.exe: error while loading shared libraries: libhdf5hl_fortran.so.100: cannot open shared
如何解决:./real.exe: error while loading shared libraries: libhdf5hl_fortran.so.100: cannot open shared
|
Linux
Linux操作系统下proj4库编译与安装及ERROR 6: Unable to load PROJ.4 library (libproj.so)问题解决
Linux操作系统下proj4库编译与安装及ERROR 6: Unable to load PROJ.4 library (libproj.so)问题解决
854 0
|
数据可视化 编译器 Windows
CMake“cmake is not able to compile a simple test program”错误 的解决方法
CMake“cmake is not able to compile a simple test program”错误 的解决方法
796 0