14

I get an error with the type definitions. I am working with Visual Studio 2017 and so I included stdint.h for the type definitions. But I still have the Problem that the identifier uint8_t is undefined.

What's the problem?

Sinem
  • 143
  • 1
  • 1
  • 4
  • 1
    Works fine on godbolt: https://godbolt.org/g/BYunXA, you'll need to provide more info (and a [mcve]) – UnholySheep May 15 '18 at 09:03
  • 1
    For C++11 and later the more appropriate header would be ``. – super May 15 '18 at 09:13
  • When I get similar errors, it is usually because I have typed `unit` instead of `uint`. Please show the exact compiler message! – Bo Persson May 15 '18 at 09:38
  • 2
    `` or ``? Prefer the latter, and use the full name, `std::uint8_t`. Note that implementations only provide fixed-width types if it's convenient for them; consider `std::uint_fast8_t` or `std::uint_least8_t` instead, according to your needs. – Toby Speight May 15 '18 at 09:49

1 Answers1

20

it is defined in "stdint.h", add that on the top of your cpp-file:

#include <stdint.h>
PanicMan
  • 244
  • 2
  • 4