This is the simplest case ~ but I often make the mistake (basic is also the reason of this a few of the most likely)
in addition, the Internet was also pointed out the following reasons can cause the prompt error:
2. A dependency error occurred when header files #include each other. For example, the header file forms a circular dependency,
/***file a ****/
#ifndef FILE_A_
#define FILE_A_
#include <file b>
#endif
/****file b ***/
#ifndef FILE_B_
#define FILE_B_
#include <file a>
#endif
If variables, functions, and classes in file A are used in file B, then #ifndef and #define are used in file B, and #include <; file a> Unable to execute #include
so, will cause the macro name repetition, there must be a header file for # # ifndef lost effect. Was not decleared in this scope?The header file was not decleared in this scope