为什么Microsoft Visual Studio找不到< stdint.h&gt ;? [英] Why Microsoft Visual Studio cannot find <stdint.h>?

查看:1181
本文介绍了为什么Microsoft Visual Studio找不到< stdint.h&gt ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

Visual Studio支持新的C / C ++标准?

请参阅维基中的以下文字:

C99标准包括几个新的整数类型的定义,以增强程序的可移植性[2]。已经可用的基本整数类型被认为不足,因为它们的实际大小是实现定义的,并且可能在不同系统间变化。新类型在嵌入式环境中尤其有用,其中硬件通常仅支持几种类型,并且支持因系统而异。所有新类型在inttypes.h头文件(C ++中的cinttypes头文件)中定义,也可以在stdint.h头文件(C ++中的cstdint头文件)中找到。类型可以分为以下类别:

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:

我的visual studio找不到任何这些文件:

My visual studio can not find any of this files:


  1. < cstdint>

  2. < cinttypes>

  3. < stdint.h>

  4. < inttypes.h>

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

为什么?

推荐答案

MSVC对C语言的支持非常差,他们不支持C90以外的任何东西。 Herb Sutter已在其博客中公开说明了此

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> 支持 MSVC2012

有一个 msinttypes 项目填补了stdint.h和inttypes.h在Microsoft Visual Studio中。

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

Boost还提供boost/cstdint.hpp (如果您没有)。

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

这篇关于为什么Microsoft Visual Studio找不到&lt; stdint.h&gt ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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