uintX_t does not name a type

Hi everyone!
I had create several libraries for my project and got controversial issue! 2 out 3 libraries have this error:

‘uint8_t’ does not name a type
‘uint16_t’ does not name a type
‘uint32_t’ does not name a type
Безымянный

I wounder why and how to solve this issue!

All my libraries located in Lib folder of my project. In all CPP files I included <Arduino.h>, because I use millis function.
Here are the settings from my platformio.ini file:
platform = atmelavr
board = uno
framework = arduino
I belive this information could help you.

I found solution of this problem.
In CPP file firstly we need to include <Arduino.h> and then other libraries/ header files

A more minimal way is to #include <stdint.h>, but if you need Arduino functionality anyways, it’s better to do Arduino.h.

1 Like