…
…
…
… error C2061: syntax error : identifier ‘THIS_FILE’
… /new(35) : error C2091: function returns function
… /new(35) : error C2809: ‘operator new’ has no formal parameters
… /new(36) : error C2061: syntax error : identifier ‘THIS_FILE’
… /new(37) : error C2091: function returns function
very strange, yesterday this class has been tested, no problem, look up the Internet, finally found the problem.
Solutions:
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__!
#endif
#include “selectserver. h”
search, found these errors were related to the STL header file and VC6 generated in the CPP file, the STL header file is the following lines:
#pragma warning (disable:4786)
#include < list>
using namespace std;
The lines of code generated by VC6 in the CPP file are the following:
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
STL header file to be written in the VC6 generated in the CPP file a few lines of code, remember! My “selectServer.h” file contains the STL header, so when you include” selectServer.h “in any other CPP file, be sure to include the #include” selectServer.h” in front of the lines of code that VC6 generates! So let’s change it to the following so that it compiles.
#include “SelectServer.h”
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
Conclusion in
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
Do not write #include after the introduction file error-prone move #include statements to the front of the paragraph
Read More:
- error C2146: syntax error : missing ‘;’ before identifier ‘fd’
- Error c2065: ‘new’: undeclared identifier, mainly because it is a. C file
- winnt.h C2146 error C2146: syntax error : missing ‘;’ before identifier ‘PVOID64’
- VS2010 library function problem: objidl. H (11266): error c2061: syntax error: identifier ‘__ RPC__ out_ xcount_ part’
- error C2061: syntax error : identifier ‘BinryTreeNode’
- Error c3861: “strcasecmp”: identifier not found
- Error c3861: identifier not found | identifier not found
- syntax error on token “catch”,Identifier expected
- Syntax error: invalid character in identifier
- Error C2065 ‘cout’: undeclared identifier
- error C2065: ‘cout’ : undeclared identifier
- error C2065: ‘_beginthread‘ : undeclared identifier
- Successfully resolved error c3861: ‘printf’: identifier not found
- error C2065: “_ LPW “: undeclared identifier
- “Unexpected syntax error: unexpected identifier”.
- “Undeclared identifier” still reported in declaration header file
- [development experience] solution to unexpected syntax error: unexpected identifier in JSON parsing
- Solutions to error c2143: syntax error: missing ‘;’ before ‘type’ in C + + program compilation
- Syntax error on token “eat”, identifier expected after this token
- Error 3 error C2065: ‘endl‘ : undeclared identifier-Error 2 error C2065: ‘cout‘ : undeclared identif