Cannot build the simples Arduino program

Hi all,

I am working on a project to create my own UART library, have been working on this for some weeks with no problem on PlatformIO and no problem with uploading to my Arduino UNO. Today I wanted to continue, typed some code (nothing major, just a simple int here and a char there) and wanted to upload. Suddenly I got a whole list of error messages which I have no idea where they come from.

so I tried to create a new empty project and see if I got the same erros, which I did. Please see below

Have already tried reinstalling PlatformIO and deleting the .vscode folder, but both resolved nothing.
Would love if anyone has any idea what is happening and how to solve this!

Standard new project:

#include <Arduino.h>

void setup()
{
}

void loop()
{
}

platfromio.ini:

[env:uno]
platform = atmelavr
board = uno
framework = arduino

Small part of errors:

Processing uno (platform: atmelavr; board: uno; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR (3.4.0) > Arduino Uno
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 31.50KB Flash
DEBUG: Current (avr-stub) On-board (avr-stub, simavr)
PACKAGES:
 - framework-arduino-avr 5.1.0
 - toolchain-atmelavr 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 13 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\uno\src\main.cpp.o
Compiling .pio\build\uno\FrameworkArduino\CDC.cpp.o
Compiling .pio\build\uno\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pio\build\uno\FrameworkArduino\HardwareSerial0.cpp.o
Compiling .pio\build\uno\FrameworkArduino\HardwareSerial1.cpp.o
Compiling .pio\build\uno\FrameworkArduino\HardwareSerial2.cpp.o
Compiling .pio\build\uno\FrameworkArduino\HardwareSerial3.cpp.o
Compiling .pio\build\uno\FrameworkArduino\IPAddress.cpp.o
In file included from C:\Users\mv\.platformio\packages\framework-arduino-avr\cores\arduino\USBAPI.h:23:0,
                 from C:\Users\mv\.platformio\packages\framework-arduino-avr\cores\arduino\CDC.cpp:19:
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\inttypes.h:77:9: error: 'int32_t' does not name a type; did you mean 'char32_t'?
 typedef int32_t int_farptr_t;
         ^~~~~~~
         char32_t
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\inttypes.h:81:9: error: 'uint32_t' does not name a type; did you mean 'char32_t'?
 typedef uint32_t uint_farptr_t;
         ^~~~~~~~
         char32_t
In file included from C:\Users\mv\.platformio\packages\framework-arduino-avr\cores\arduino\USBAPI.h:24:0,
                 from C:\Users\mv\.platformio\packages\framework-arduino-avr\cores\arduino\CDC.cpp:19:
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:1529:25: error: 'uint_farptr_t' was not declared in this scope
 extern size_t strlen_PF(uint_farptr_t src) __ATTR_CONST__; /* program memory can't change */
                         ^~~~~~~~~~~~~
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:1545:26: error: 'uint_farptr_t' was not declared in this scope
 extern size_t strnlen_PF(uint_farptr_t src, size_t len) __ATTR_CONST__; /* program memory can't change */
                          ^~~~~~~~~~~~~
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:1545:52: error: expected primary-expression before 'len'
 extern size_t strnlen_PF(uint_farptr_t src, size_t len) __ATTR_CONST__; /* program memory can't change */
                                                    ^~~
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:1560:36: error: 'uint_farptr_t' has not been declared
 extern void *memcpy_PF(void *dest, uint_farptr_t src, size_t len);
                                    ^~~~~~~~~~~~~
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:1575:36: error: 'uint_farptr_t' has not been declared
 extern char *strcpy_PF(char *dest, uint_farptr_t src);
                                    ^~~~~~~~~~~~~
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:1595:37: error: 'uint_farptr_t' has not been declared
 extern char *strncpy_PF(char *dest, uint_farptr_t src, size_t len);
                                     ^~~~~~~~~~~~~
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:1611:36: error: 'uint_farptr_t' has not been declared
 extern char *strcat_PF(char *dest, uint_farptr_t src);
                                    ^~~~~~~~~~~~~
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:1632:37: error: 'uint_farptr_t' has not been declared
 extern size_t strlcat_PF(char *dst, uint_farptr_t src, size_t siz);
                                     ^~~~~~~~~~~~~
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:1649:37: error: 'uint_farptr_t' has not been declared
 extern char *strncat_PF(char *dest, uint_farptr_t src, size_t len);
                                     ^~~~~~~~~~~~~
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:1665:38: error: 'uint_farptr_t' has not been declared
 extern int strcmp_PF(const char *s1, uint_farptr_t s2) __ATTR_PURE__;
                                      ^~~~~~~~~~~~~
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:1682:39: error: 'uint_farptr_t' has not been declared
 extern int strncmp_PF(const char *s1, uint_farptr_t s2, size_t n) __ATTR_PURE__;
                                       ^~~~~~~~~~~~~
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:1698:42: error: 'uint_farptr_t' has not been declared
 extern int strcasecmp_PF(const char *s1, uint_farptr_t s2) __ATTR_PURE__;
                                          ^~~~~~~~~~~~~
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:1716:43: error: 'uint_farptr_t' has not been declared
 extern int strncasecmp_PF(const char *s1, uint_farptr_t s2, size_t n) __ATTR_PURE__;
                                           ^~~~~~~~~~~~~
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:1732:40: error: 'uint_farptr_t' has not been declared
 extern char *strstr_PF(const char *s1, uint_farptr_t s2);
                                        ^~~~~~~~~~~~~
c:\users\mv\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:1744:37: error: 'uint_farptr_t' has not been declared
 extern size_t strlcpy_PF(char *dst, uint_farptr_t src, size_t siz);
                                     ^~~~~~~~~~~~~

Please see Error : showing up on every project - #2 by maxgerhardt.

1 Like