什么是C运行时库? [英] What is the C runtime library?

查看:113
本文介绍了什么是C运行时库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我知道这也许是最愚蠢的问题,这里曾经问,但是实际上是C运行时库,用于什么呢?我在寻找,谷歌搜索像一个魔鬼,但我无法找到任何东西比微软的好:微软运行时库编程微软Windows操作系统提供程序,这些程序自动不由提供了许多常见的编程任务。 C和C ++语言。

OK, I know this is maybe the most stupid question ever asked here, but what actually is C runtime library and what is used for? I was searching, Googling like a devil, but I couldn't find anything better than Microsoft's: "The Microsoft run-time library provides routines for programming for the Microsoft Windows operating system. These routines automate many common programming tasks that are not provided by the C and C++ languages."

OK,我得到的,但例如,什么是 LIBCMT.LIB ?它有什么作用?我认为C标准库是C编译器的一部分。那么, LIBCMT.LIB Windows的实现C标准库函数来win32下工作?

OK, I get that, but for example, what is in libcmt.lib? What does it do? I thought that the C standard library was a part of C compiler. So is libcmt.lib Windows' implementation of C standard library functions to work under win32?

推荐答案

是的,libcmt是提供了与微软的编译器的C标准库的实现(其中一数)。他们同时提供调试等三种基本类型库的释放的版本:单线程(总是静态链接),多线程静态链接和<强>多线程动态链接(不过,这取决于您使用的编译器的版本,其中的一些可能不是present)。

Yes, libcmt is (one of several) implementations of the C standard library provided with Microsoft's compiler. They provide both "debug" and "release" versions of three basic types of libraries: single-threaded (always statically linked), multi-threaded statically linked, and multi-threaded dynamically linked (though, depending on the compiler version you're using, some of those may not be present).

所以,在名为libcmt,libc中是用于C库(或多或少)传统名。该MT是指多线程。 调试版本将有一个D添加到末尾,给予libcmtd。

So, in the name "libcmt", "libc" is the (more or less) traditional name for the C library. The "mt" means "multi-threaded". A "debug" version would have a "d" added to the end, giving "libcmtd".

至于哪些功能,它包括,C标准(第7部分,如果你碰巧关心)定义了一组功能的符合(托管)实现必须提供。大多数供应商(包括微软)加入各种其他功能本身(兼容性,提供能力标准功能没有解决,等等)。在大多数情况下,它也包含了不少内部由编译器使用的功能但不是通常由终端用户

As far as what functions it includes, the C standard (part 7, if you happen to care) defines a set of functions a conforming (hosted) implementation must supply. Most vendors (including Microsoft) add various other functions themselves (for compatibility, to provide capabilities the standard functions don't address, etc.) In most cases, it will also contain quite a few "internal" functions that are used by the compiler but not normally by the end user.

如果你想获得的功能的完整列表中的libcmt(使用你的例子),你可以打开Visual Studio命令提示之一(在Visual Studio工具,正常),切换到目录中您的库安装,并键入类似: lib中-list LIBCMT.LIB ,它会产生一个(的的)的名称列表该库中的所有对象文件。那些不总是对应的直接的函数的名称的,但一般会给一个想法。如果你想看看一个特定的目标文件,可以使用 LIB -extract 来提取这些目标文件之一,那么使用`DUMPBIN /符号,以查找功能(多个)/是在那个特定的对象文件。

If you want to get a complete list of the functions in "libcmt" (to use your example) you could open one of the Visual Studio command prompts (under "Visual Studio Tools", normally), switch to the directory where your libraries were installed, and type something like: lib -list libcmt.lib and it'll generate a (long) list of the names of all the object files in that library. Those don't always correspond directly to the names of the functions, but will generally give an idea. If you want to look at a particular object file, you can use lib -extract to extract one of those object files, then use `dumpbin /symbols " to find what function(s) is/are in that particular object file.

这篇关于什么是C运行时库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆