Write the program in the morning, added a previous write a class, compile encountered the following error:
... error C2061:syntax error:identifier ' This_file '
.../new (+): Error c2091:function returns function
.../new (+): Error C2809: ' operator new ' has no formal parameters
/new: Error c2061:syntax error:identifier ' This_file '
.../new (PNS): Error c2091:function returns function
Very strange, yesterday this kind of test, no problem ah, on the Internet to check a bit, finally found the problem lies.
Workaround:
The newly added class is Cselectserver, which uses the STL, which is called in HouServer.cpp, and is written as follows when HouServer.cpp contains CSelectServer.h files:
#ifdef _DEBUG
#define NEW Debug_new
#undef This_file
static char this_file[] = __file__;
#endif
#include "SelectServer.h"
Search the Internet, found that these errors with the STL header file and VC6 in the CPP file generated in a few lines of code, the STL header file refers to the following lines:
#pragma warning (disable:4786)
#include <list>
using namespace Std;
VC6 several lines of code generated in the CPP file refer to the following lines:
#ifdef _DEBUG
#define NEW Debug_new
#undef This_file
static char this_file[] = __file__;
#endif
The STL header file should be written in VC6 before the several lines of code generated in the CPP file. My "SelectServer.h" file contains the STL header file, when you include "SelectServer.h" file in other CPP files, make sure to place the # include "SelectServer.h" before the lines of VC6 generated. So change to the following to compile through.
#include "SelectServer.h"
#ifdef _DEBUG
#define NEW Debug_new
#undef This_file
static char this_file[] = __file__;
#endif
Summarized in
#ifdef _DEBUG
#define NEW Debug_new
#undef This_file
static char this_file[] = __file__;
#endif
Do not write #include the introduction of the file is error-prone to transfer the # include statement to the front of this conversation