My question is not really hard but I can't find a proper answer on the web to my problem.
I define a .h file
that contains a struct and declare some enum in it. I want to use that struct in another .cpp file
. But the compilation return me error.
Here's my code variableStruct.h file
:
struct variableSupervision {
std::string Donnees;
enum TYPE
{
ENUM,
INT,
FLOAT,
BOOL
};
enum UNITE
{
ETAT,
A,
V,
TBC,
DEGREEE
};
enum IN
{
SYSTEMMONITOR,
MODEMANAGEMENT
};
enum OUT
{
SLIDECONTROL,
MODEMANAGEMENT,
HMICONTROL,
MOTORCONTROL
};
enum GET {X};
std::string Commentaire ;
};
The error is : redeclaration Of MODEMANAGEMENT
. I don't understand why, because they are in two different enum. Should I create different separate file for each enum ?