简体   繁体   English

仅Windows的C ++库

[英]c++ Libraries for windows only

here is a list with c++ headers. 这是带有c ++标头的列表。
I would like to know if they can be used to compile programs only for windows or for other systems too: 我想知道它们是否也只能用于Windows或其他系统的编译程序:

iostream or iostream.h
stdio.h
cstdlib
math.h

Almost all those library headers may be used to compile for any operating system, they are maintained by ISO C++, a standardization committee. 几乎所有这些库头都可用于任何操作系统的编译,它们由标准化委员会ISO C ++维护。

https://isocpp.org/faq https://isocpp.org/faq

Note however the exception is iostream.h . 请注意,但是例外是iostream.h It won't compile for most modern compilers as it is part of a pre standard (the standard being what is defined by the ISO committee). 它不是大多数标准编译器的编译器,因为它是预标准(ISO委员会定义的标准)的一部分。

Just use 只需使用

#include <iostream> 

instead. 代替。

You can compile standard C++ compliant code for almost any system, no matter of windows, linux, iOs, etc. 您可以为几乎所有系统编译标准的C ++兼容代码,无论Windows,Linux,iO等如何。

iostream or iostream.h

iostream.h is not a standard library header. iostream.h不是标准库头。 It was used by ancient compilers (eg Turbo C++), before any c++ standard was established. 在建立任何c ++标准之前,古代编译器(例如Turbo C ++)已使用它。 These were only available for old windows/DOS systems IIRC. 这些仅适用于旧的Windows / DOS系统IIRC。

stdio.h math.h stdio.h math.h

These refer to the c library, and can be used in standard c++ 这些引用了c库,可以在标准c ++中使用

cstdlib

This is the c++ wrapper for the corresponding c library header stdlib.h available in the current standard. 这是当前标准中可用的对应c库头stdlib.h的c ++包装器。

The files you listed are not libraries, but header files. 您列出的文件不是库,而是头文件。

They are part of the standard C++ (for iostream ) and C (for math.h stdio.h ) libraries. 它们是标准C ++(对于iostream )和C(对于math.h stdio.h )库的一部分。 Every compiler that is conformant to those standards has to have these headers for you to use. 每个符合这些标准的编译器都必须具有这些标头供您使用。

To clarify: You cannot copy those files from your compiler on Windows and use them on another platform, but your program is free to use them, because the compiler has to provide them. 需要说明的是:您不能在Windows上从编译器复制这些文件并在另一个平台上使用它们,但是您的程序可以自由使用它们,因为编译器必须提供它们。

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

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