So the other day I went to compile a VC++ project I am working on and all of a sudden I get errors in almost all of my files saying:
new.h: error C2039: ‘set_new_handler’ : is not a member of ‘std
new.h: error C2039: ‘set_new_handelr’ : symbol cannot be used in a using-declaration
“new.h” and ‘set_new_handler’ are not being used in any of my files, so I have no idea how or why these errors are suddenly appearing since they relate to a windows/VS library file.
Would anyone know what I can do to clear this error and compile my code again?
UPDATE After examining the files being included upon compilation, some files are including and some are . The problem is that is being included in afxwin.h and is being included in a third-party library. I honestly have no idea what to do with this problem…no other developers that have played with this code are running into this problem, may it be a settings problem? I am not using precompiled headers.
If I were to hazard a guess, I would say that
<new.h>declaresset_new_handlerin the global namespace and<new>declares it within thestdnamespace. Some code is including<new.h>and expecting it to act as if it had included<new>. I would suspect either some 3rd party library/header or a precompiled header as suggested by Evan.You can narrow down the culprit using either
/showIncludesor pre-processing a source code file (using/E) and examining the output. I usually use the latter and look at the#linedirectives in the output file to figure out the include chain.Good luck.