Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c++

std

stdint

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?

like image 781
Narek Avatar asked Oct 19 '12 08:10

Narek


People also ask

What is #include Stdint H?

h is a header file in the C standard library introduced in the C99 standard library section 7.18 to allow programmers to write more portable code by providing a set of typedefs that specify exact-width integer types, together with the defined minimum and maximum allowable values for each type, using macros .

How do I add a header file in Visual Studio?

Place your caret on the first line of any C# or Visual Basic file. Press Ctrl+. to trigger the Quick Actions and Refactorings menu. Select Add file header. To apply the file header to an entire project or solution, select Project or Solution under the Fix all occurrences in: option.


1 Answers

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 (exported from the original repo on Google Code) 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.

like image 155
Jesse Good Avatar answered Nov 15 '22 17:11

Jesse Good