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
Read More:
- Vs cannot open the source file unistd. H under Windows
- How to solve fatal error C1010!
- Error resolution of ‘string’ does not name a type
- Error resolution: Error: redefinition of class xxx
- Error c2011: “a certain class”: redefinition of “class” type
- Error: redefinition of class XXX
- Error c2061: syntax error: identifier ‘this_ FILE’
- Some small problems in using vs2017
- g++ error analysis error: unterminated #ifndef
- Arduino ide 1.6.9 problems encountered error:’TKD2′ was not declared in this scope
- OpenGL development environment configuration [vs2017] + common problems
- Summary of problems encountered by CodeBlocks + OpenGL
- VS2010 compiler can’t open include file: “GL / glaux. H”: no such file or directory
- /usr/include/boost/type_traits/detail/has_binary_operator.hp:50: Parse error at “BOOST_JOIN”
- Solutions to several VTK compilation errors (vtk5.8 + VS2010)
- fatal error LNK1120: 1 unresolved externals
- Solution to stray’\357′ in program when gcc is compiled
- Using the third party OpenGL in codeblock
- About the prompt: invalid use of incomplete type
- Vs compiling OpenGL project, the solution of unable to open the source file “GL / glaux. H” appears