Defined struct was not declared in this scope error

hi,
I have a problem. My c++ level very very low. I am c# developer. I need to help.
This is my Storage.h

#include <EEPROM/EEPROM.h>
#define CONFIG_START 32
#define CONFIG_VERSION "mkb"
class Storage
{
public:
Storage();
static void LoadConfig();
static void SaveConfig();
};

and this my Storage.cpp

#include "storage.h"
#include <EEPROM.h>
// ESP Eeprom Ayarlar Bilgisi
struct Settings {
char version[4];
// Motor 1 : Sırt Motoru
int MOTOR1_UP_PIN;
int MOTOR1_DOWN_PIN;
int MOTOR1_UP_LIMIT;
int MOTOR1_DOWN_LIMIT;
// Motor 2 : Bel Motoru
int MOTOR2_PIN;
int MOTOR2_DOWN_PIN;
int MOTOR2_UP_LIMIT;
int MOTOR2_DOWN_LIMIT;
// Motor 3 : Ayak Motoru
int MOTOR3_PIN;
int MOTOR3_DOWN_PIN;
int MOTOR3_UP_LIMIT;
int MOTOR3_DOWN_LIMIT;
// Motor 4 : Ayak Motoru
int MOTOR4_PIN;
int MOTOR4_DOWN_PIN;
int MOTOR4_UP_LIMIT;
int MOTOR4_DOWN_LIMIT;
// Okuma Lambası
int LIGHT_PIN;
int LIGHT_SENSIVITY;
bool HAS_CALIBRATED;
bool HAS_CONFIGURED;
} settings;
Storage::Storage() {
}
void Storage::LoadConfig() {
// To make sure there are settings, and they are YOURS!
// If nothing is found it will use the default settings.
if (EEPROM.read(CONFIG_START + 0) == CONFIG_VERSION[0] &&
EEPROM.read(CONFIG_START + 1) == CONFIG_VERSION[1] &&
EEPROM.read(CONFIG_START + 2) == CONFIG_VERSION[2])
for (unsigned int t = 0; t < sizeof(settings); t++)
((char)&settings + t) = EEPROM.read(CONFIG_START + t);
else
SaveConfig();
}
void Storage::SaveConfig() {
for (unsigned int t = 0; t < sizeof(settings); t++)
EEPROM.write(CONFIG_START + t, ((char)&settings + t));
EEPROM.commit();
}

and this is "Esp8266App.ino"

#pragma region Imports
#include <ESP8266WiFi.h>
#include <WebSocketsServer.h>
#include <Hash.h>
#include <Ticker/Ticker.h>
#include "Storage.h"
#pragma endregion
DeviceState deviceState = NotReady;
void setup() {
USE_SERIAL.begin(9600);
// Hafızadaki ayarları yükle
Storage::LoadConfig();

// Aygıt ayarları yapılmamışsa durumu Ayar Gerekiyor yap
if (!settings.HAS_CONFIGURED)
{
deviceState = NeedConfig;
return;
}
// Motor kalibrasyon ayarları yapılmamışsa durumu Kalibrasyon Gerekiyor yap
if (!settings.HAS_CALIBRATED)
{
deviceState = NeedCalibrate;
return;
}
}

this code throwing error.
Error :
Esp8266App.ino: 24:7: error: 'settings' was not declared in this scope
** if (!settings.HAS_CONFIGURED)**

:roll_eyes:

How do you expect 'Esp8266App.ino' to know what the 'settings' structure looks like? Even if it did, 'if (!settings.HAS_CONFIGURED)' makes no sense because it's not referencing a variable (object) of type 'settings'.

gfvalvo:
How do you expect 'Esp8266App.ino' to know what the 'settings' structure looks like? Even if it did, 'if (!settings.HAS_CONFIGURED)' makes no sense because it's not referencing a variable (object) of type 'settings'.

I defined "settings" variable after struct defination in Storage.cpp.

struct Settings {
char version[4];

// Motor 1 : Sırt Motoru
int MOTOR1_UP_PIN;
int MOTOR1_DOWN_PIN;
int MOTOR1_UP_LIMIT;
int MOTOR1_DOWN_LIMIT;

// Motor 2 : Bel Motoru
int MOTOR2_PIN;
int MOTOR2_DOWN_PIN;
int MOTOR2_UP_LIMIT;
int MOTOR2_DOWN_LIMIT;

// Motor 3 : Ayak Motoru
int MOTOR3_PIN;
int MOTOR3_DOWN_PIN;
int MOTOR3_UP_LIMIT;
int MOTOR3_DOWN_LIMIT;

// Motor 4 : Ayak Motoru
int MOTOR4_PIN;
int MOTOR4_DOWN_PIN;
int MOTOR4_UP_LIMIT;
int MOTOR4_DOWN_LIMIT;

// Okuma Lambası
int LIGHT_PIN;
int LIGHT_SENSIVITY;

bool HAS_CALIBRATED;
bool HAS_CONFIGURED;

} settings;

How can I refer the "settings" variable in main.ino file ?

The way your code is posted now, it's too difficult to read. Why make it harder for people who are trying to help you FOR FREE?

Start by reading: Read this before posting a programming question ...

Read it all, but pay particular attention to Item #6 - how to properly post your code using "code tags". Before posting again, auto-format your code (ctrl-t in the Arduino IDE) and get rid of superfluous white space and blank lines. Also, post a COMPLETE PROGRAM. All files, not just snippets.

Perhaps with properly posted code, someone will be willing to help you further.