PlatformIO Community

ESP8266 was not declared in this scope

Help me figure out the scale. Here is a brief example in the screenshot. Why variables from perem.h are not global and are not visible in func.cpp . There was no such problem in the Arduino IDE.
1
2
3
4
5

In func.cpp you do not include perem.h, so they cannot possibly show up.

But your perem.h file is wrong too, instead of doing global variable definitions in a header, you should only put an extern declaration there and then use a perem.cpp file to define the global variables.

Write perem.h as

#pragma once

extern int timer500;
extern int timer1000;
extern int caution;
extern bool timerFlag500;
extern bool timerFlag 1000;

then write a perem.cpp file with #include "perem.h" and the variable definitions from your original perem.h` file.