Can't debug if including 'vector'
-
If i try to compile my mfc dialog application in DEBUG configuration with a '#include inside one of my cpp files or headers, i get the following error messages: c:\program files\microsoft visual studio\vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(35) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(35) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\new(36) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(37) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(37) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl op erator new(void))(unsigned int)' c:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(16) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2784: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' : could not deduce template argument for 'void *(__cdecl *)(u nsigned int,class std::allocator<_Ty> &)' from 'void *(__cdecl *)(unsigned int)' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2785: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' and 'void *(__cdecl *__cdecl operator new(void))(unsigned int )' have different return types c:\program files\microsoft visual studio\vc98\include\memory(16) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\memory(20) : error C2954: template definitions cannot nest Error executing cl.exe. Creating browse info file... I can't figure out why this happens or how to fix it. BTW it compiles without the #include in DEBUG configuration. And it also compiles with/without it in RELEASE configuration. I'm using VC++ 6
-
If i try to compile my mfc dialog application in DEBUG configuration with a '#include inside one of my cpp files or headers, i get the following error messages: c:\program files\microsoft visual studio\vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(35) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(35) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\new(36) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(37) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(37) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl op erator new(void))(unsigned int)' c:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(16) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2784: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' : could not deduce template argument for 'void *(__cdecl *)(u nsigned int,class std::allocator<_Ty> &)' from 'void *(__cdecl *)(unsigned int)' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2785: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' and 'void *(__cdecl *__cdecl operator new(void))(unsigned int )' have different return types c:\program files\microsoft visual studio\vc98\include\memory(16) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\memory(20) : error C2954: template definitions cannot nest Error executing cl.exe. Creating browse info file... I can't figure out why this happens or how to fix it. BTW it compiles without the #include in DEBUG configuration. And it also compiles with/without it in RELEASE configuration. I'm using VC++ 6
-
If i try to compile my mfc dialog application in DEBUG configuration with a '#include inside one of my cpp files or headers, i get the following error messages: c:\program files\microsoft visual studio\vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(35) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(35) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\new(36) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(37) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(37) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl op erator new(void))(unsigned int)' c:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(16) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2784: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' : could not deduce template argument for 'void *(__cdecl *)(u nsigned int,class std::allocator<_Ty> &)' from 'void *(__cdecl *)(unsigned int)' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2785: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' and 'void *(__cdecl *__cdecl operator new(void))(unsigned int )' have different return types c:\program files\microsoft visual studio\vc98\include\memory(16) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\memory(20) : error C2954: template definitions cannot nest Error executing cl.exe. Creating browse info file... I can't figure out why this happens or how to fix it. BTW it compiles without the #include in DEBUG configuration. And it also compiles with/without it in RELEASE configuration. I'm using VC++ 6
At last i got it 2 compile by putting #include above all mfc includes. Is the right way to go when mixing STL with MFC ? ScorpioMidget
-
If i try to compile my mfc dialog application in DEBUG configuration with a '#include inside one of my cpp files or headers, i get the following error messages: c:\program files\microsoft visual studio\vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(35) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(35) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\new(36) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(37) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(37) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl op erator new(void))(unsigned int)' c:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(16) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2784: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' : could not deduce template argument for 'void *(__cdecl *)(u nsigned int,class std::allocator<_Ty> &)' from 'void *(__cdecl *)(unsigned int)' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2785: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' and 'void *(__cdecl *__cdecl operator new(void))(unsigned int )' have different return types c:\program files\microsoft visual studio\vc98\include\memory(16) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\memory(20) : error C2954: template definitions cannot nest Error executing cl.exe. Creating browse info file... I can't figure out why this happens or how to fix it. BTW it compiles without the #include in DEBUG configuration. And it also compiles with/without it in RELEASE configuration. I'm using VC++ 6
Move the vector header include above the debugging macro 'hack' that VC6 uses
#include <vector>
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif:)