Why Microsoft Visual Studio cannot find <stdint.h>? [duplicate]

守給你的承諾、 提交于 2019-12-18 05:49:28

问题


Possible Duplicate:
Visual Studio support for new C / C++ standards?

See the text below from wiki:

The C99 standard includes definitions of several new integer types to enhance the portability of programs[2]. The already available basic integer types were deemed insufficient, because their actual sizes are implementation defined and may vary across different systems. The new types are especially useful in embedded environments where hardware supports usually only several types and that support varies from system to system. All new types are defined in inttypes.h header (cinttypes header in C++) and also are available at stdint.h header (cstdint header in C++). The types can be grouped into the following categories:

My visual studio can not find any of this files:

  1. <cstdint>
  2. <cinttypes>
  3. <stdint.h>
  4. <inttypes.h>

Why?


回答1:


EDIT

Note that starting from Visual Studio 2013, C99 library support has been added to Visual Studio.

The answer below is my old answer before Visual Studio 2013 added support:


MSVC has very poor support for the C language, they do not support anything past C90. Herb Sutter has already publicly stated this in his blog.

<cstdint> is supported from MSVC2012.

There is a msinttypes project that fills the absence of stdint.h and inttypes.h in Microsoft Visual Studio.

Boost also provides boost/cstdint.hpp if you do not have it.



来源:https://stackoverflow.com/questions/12970293/why-microsoft-visual-studio-cannot-find-stdint-h

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!