…
…
…
… 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:
- How to solve fatal error C1010!
- Analysis of the causes of errors in G + + compilation “was not declared in this scope”“
- Vs cannot open the source file unistd. H under Windows
- IOS reverse error: use of undeclared identifier ‘mshookivar’
- Solutions to several VTK compilation errors (vtk5.8 + VS2010)
- Error c2011: “a certain class”: redefinition of “class” type
- Gcc compiler warning solution: “extra tokens at end of ifndef directive” Tags: GCC, warning
- [Warning] incompatible implicit declaration of built-in function ‘strcat’
- Error resolution: Error: redefinition of class xxx
- Error resolution of ‘string’ does not name a type
- error C2146: syntax error : missing ‘;’ before identifier ‘fd’
- Error: redefinition of class XXX
- Some small problems in using vs2017
- C language write() function analysis: write failed bad address
- Expected unqualified ID before string constant
- C++ compiler prompt “undefined reference to…”[How to Fix]
- About the prompt: invalid use of incomplete type
- Codeblock configuring OpenGL
- Summary of problems encountered in compiling opengl code
- Using the third party OpenGL in codeblock