简体   繁体   English

关于C ++库

[英]About C++ Libraries

When I install an IDE like VB for example, it has C++ libraries. 例如,当我安装VB之类的IDE时,它具有C ++库。
The question is, how to know the contents of a library (methods or manipulators) the way I am intended to do. 问题是,如何以我打算的方式知道库的内容(方法或操纵器)。
Where should a beginner find the contents formally? 初学者应该在哪里正式找到内容?
I found them in Wikipedia, but I want to know the original source (if we suppose that no internet connection is available). 我在Wikipedia中找到了它们,但我想知道原始信息(如果我们假设没有可用的互联网连接)。

MSDN would be a good source. MSDN将是一个很好的来源。 And C++ Reference too. 还有C ++参考

You can donwload the current image of cppreference.com wiki at this address. 您可以在地址下载cppreference.com Wiki的当前图像。 It is updated daily. 它每天更新。

Simple question here, when i install an IDE like vb for example, it has c++ libraries. 这里有一个简单的问题,例如,当我安装像vb这样的IDE时,它具有c ++库。

What libraries are you referring to? 您指的是什么库?

where should a beginner find the contents formally? 初学者应该在哪里正式找到内容?

Libraries that are meant for public consumption are described in their respective documentation. 供公共消费的图书馆在其各自的文档中进行了描述。 Where that documentation is found differs greatly. 该文件被发现有很大的不同。 Most documentations for big public libraries are found online, on the official websites of these libraries, though. 大型公共图书馆的大多数文档都可以在网上找到,也可以在这些图书馆的官方网站上找到。

Since the question explicitly mentioned C++, the C++ standard libraries are described at cplusplus.com . 由于问题已明确提到C ++,因此在cplusplus.com上介绍了C ++标准库。 There is another large collection of C++ libraries, called Boost which is described on their homepage. C ++库的另一大集合称为Boost ,在其主页上进行了介绍。

The libraries that ship with VB ( which VB, though? VB.NET or VB6?) are Microsoft's, and are therefore described on their developer network homepage, msdn.microsoft.com . VB附带的库( 哪个 VB,是VB.NET还是VB6?)是Microsoft的,因此在其开发人员网络主页msdn.microsoft.com中进行了描述 An offline copy of this documentation is installed with Visual Studio; 该文档的脱机副本与Visual Studio一起安装; however, the software used to navigate it is barely usable (especially when accessed via Visual Studio). 但是,用于导航的软件几乎不可用(尤其是通过Visual Studio访问时)。

The original source are the header files (.h files). 原始源是头文件 (.h文件)。 In these files you will find the functions declarations and class definitions. 在这些文件中,您将找到函数声明和类定义。 In some cases, like template code, you will also see the implementationl. 在某些情况下,例如模板代码,您还将看到实现。 In others, the implementation will be precompiled into a .dll or .lib file and you can't see it. 在其他情况下,该实现将被预编译为.dll或.lib文件,您看不到它。 But all available things are in the header file. 但是所有可用的东西都在头文件中。 To use its contents you must #include the header file and link against the implementation. 要使用其内容,您必须#include头文件并链接到实现。 For standard library, the linking is done for you by the IDE 对于标准库,IDE会为您完成链接

Everything that comes with Visual Studio and its subset installations is documented on MSDN . MSDN上记录了Visual Studio及其子集安装附带的所有内容。 Do you have more specific questions re the C++ libraries? 关于C ++库,您还有其他更具体的问题吗? Do you need info on Win32, C runtime (CRT), C++ standard library? 您需要有关Win32,C运行时(CRT),C ++标准库的信息吗?

Every lib usually has a coupled header ( .h ) file that describes the signatures of methods and types available with that library. 每个lib通常都有一个耦合的标头( .h )文件,该文件描述了该库可用的方法和类型的签名。 The library is linked (or dynamically loaded and linked) with the executable while the header is used during compilation to the purpose of static checking the source. 该库与可执行文件链接(或动态加载和链接),而在编译过程中使用标头以静态检查源代码的目的。

You should just look for an include folder and check its contents. 您应该只寻找一个include文件夹并检查其内容。

库的内容包含在IDE附带的标头中。

The .h files contain just the function declarations. .h文件仅包含函数声明。 The source containing the definitions is already compiled, so when you include a header, the linker looks for the function definitions in the libraries that you have linked. 包含定义的源代码已经被编译,因此当您包含头文件时,链接器将在已链接的库中查找功能定义。 Most of the libraries are open source, some of them are just specifications that anyone can implement for example OpenGL, and the standard library is a specification, too. 大多数库都是开源的,其中一些仅仅是任何人都可以实现的规范,例如OpenGL,而标准库也是一种规范。 The same goes for the C++ language. C ++语言也是如此。 Then programmers use the specifications to write implementations (GCC, VC++). 然后,程序员使用规范来编写实现(GCC,VC ++)。

Here you can download the source code of STL C++ https://www.sgi.com/tech/stl/download.html 在这里您可以下载STL C ++的源代码https://www.sgi.com/tech/stl/download.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM