Eclipse CDT C++ enum “could not be resolved”

后端 未结 2 1802
逝去的感伤
逝去的感伤 2020-12-11 18:29

I\'m developing a game in Eclipse CDT in C++/OpenGL, and it compiles and runs just fine, but for some reason an enum I\'m declaring (SCREEN_MAIN_MENU) gets underlined in red

相关标签:
2条回答
  • 2020-12-11 18:36

    This may be caused by a bug in Eclipse CDT:

    https://bugs.eclipse.org/bugs/show_bug.cgi?id=356057

    Try to rebuild the index (Right click on the project -> Index -> Rebuild)

    0 讨论(0)
  • 2020-12-11 18:38

    Have you tried creating a named type for the enum?

    i.e.

    enum SCREEN_TYPE {  SCREEN_MAIN_MENU, SCREEN_LOADING, SCREEN_GAME };
    
    0 讨论(0)
提交回复
热议问题