c++ - Error: enum "e_Sides" has no member "Left" -


i have created enum in globalgameenums.h. have included header in board.h have declared on class won't let me use enum values.

the globalgameenums.h:

#ifdef globalgameenums_h #define globalgameenums_h  enum class e_side {     right,     left };  #endif 

and board.h:

#ifndef board_h     .     .     #include "globalgameenums.h"      class board     {     public:     board(int i_boardsize, int i_lowbound, int i_highbound);     ~board();      int makeplayermove(enum e_side i_sidetaken )     {         switch (i_sidetaken)         {         case e_side::left:             break;         case e_side::right:             break;         }     }      private:     std::vector<cell> m_cellvector;     };  #endif 

in method makeplayermove's declaration recognizes e_side type in method body gives me error using left/right (error: enum "e_side" has no member "left").

i have tried lot of configurations , searched old solution couldn't working.

the header guard in enum header wrong. have #ifdef instead of #ifndef.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -