Original Post
Hi, I am having trouble with header files xdebug and xlocale. My sink.cpp file is giving me numerous errors, all related to the two header files, when I try to compile it. My stdafx.h (which compiles fine) looks like this: #if !defined(AFX_STDAFX_H__7082897A_3936_4B21_914E_6B1473BEEA3C__INCLUDED_) #define AFX_STDAFX_H__7082897A_3936_4B21_914E_6B1473BEEA3C__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #define STRICT #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0400 #endif #define _ATL_APARTMENT_THREADED #define VC_EXTRALEAN #include // MFC core and standard components #include // MFC extensions #include // MFC Automation classes #include // MFC support for Internet Explorer 4 Common Controls #ifndef _AFX_NO_AFXCMN_SUPPORT #include // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT #include extern CComModule _Module; #include #include #include #include #include #endif // !defined(AFX_STDAFX_H__7082897A_3936_4B21_914E_6B1473BEEA3C__INCLUDED) In my sink.cpp file, I am including these: #include "stdafx.h" #include "MainDlg.h" #include "Sink.h" #include #include #include "shlwapi.h" Maybe the errors that I am getting are due to the order in which I include the files?????? If I comment out the last three includes in the sink.cpp above, I still get the errors. So, there is something with the "stdafx.h" file. But, when I include "stdafx.h" file in other files, it does fine. The errors bugging me are: Compiling... Sink.cpp c:\program files\microsoft visual studio 8\vc\include\xdebug(32) : warning C4229: anachronism used : modifiers on data are ignored c:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error C2365: 'operator new' : redefinition; previous definition was 'function' c:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error C2078: too many initializers c:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error C2440: 'initializing' : cannot convert from 'int' to 'void *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast c:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error C2143: syntax error : missing ';' before '(' c:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error C2226: syntax error : unexpected type 'size_t' c:\program files\microsoft visual studio 8\vc\include\xdebug(33) : error C2059: syntax error : ')' c:\program files\microsoft visual studio 8\vc\include\xdebug(36) : warning C4229: anachronism used : modifiers on data are ignored c:\program files\microsoft visual studio 8\vc\include\xdebug(36) : error C2365: 'operator new' : redefinition; previous definition was 'function' c:\program files\microsoft visual studio 8\vc\include\xdebug(36) : error C2078: too many initializers c:\program files\microsoft visual studio 8\vc\include\xdebug(36) : error C2440: 'initializing' : cannot convert from 'int' to 'void *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast c:\program files\microsoft visual studio 8\vc\include\xdebug(36) : error C2143: syntax error : missing ';' before '[' c:\program files\microsoft visual studio 8\vc\include\xdebug(36) : error C3409: empty attribute block is not allowed c:\program files\microsoft visual studio 8\vc\include\xdebug(36) : error C2226: syntax error : unexpected type 'size_t' c:\program files\microsoft visual studio 8\vc\include\xlocale(138) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio 8\vc\include\xlocale(139) : error C2091: function returns function c:\program files\microsoft visual studio 8\vc\include\xlocale(139) : error C2802: static member 'operator new' has no formal parameters c:\program files\microsoft visual studio 8\vc\include\xlocale(139) : error C2333: 'std::locale::facet::operator new' : error in function declaration; skipping function body c:\program files\microsoft visual studio 8\vc\include\xlocale(144) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio 8\vc\include\xlocale(146) : error C2091: function returns function c:\program files\microsoft visual studio 8\vc\include\xlocale(146) : error C2556: 'void *(__cdecl *std::locale::facet::operator new(void))(size_t,const std::_DebugHeapTag_t &,char *,int)' : overloaded function differs only by return type from 'void *(__cdecl *std::locale::facet::operator new(void))(size_t)' c:\program files\microsoft visual studio 8\vc\include\xlocale(138) : see declaration of 'std::locale::facet::operator new' c:\program files\microsoft visual studio 8\vc\include\xlocale(147) : error C2059: syntax error : 'return' c:\program files\microsoft visual studio 8\vc\include\xlocale(147) : error C2238: unexpected token(s) preceding ';' c:\program files\microsoft visual studio 8\vc\include\xlocale(150) : error C2628: 'std::locale::facet' followed by 'void' is illegal (did you forget a ';'?) c:\program files\microsoft visual studio 8\vc\include\xlocale(152) : error C2817: return type for 'operator delete' must be 'void' c:\program files\microsoft visual studio 8\vc\include\xlocale(152) : error C2333: 'std::locale::operator delete' : error in function declaration; skipping function body c:\program files\microsoft visual studio 8\vc\include\xlocale(164) : error C2523: 'std::locale::~facet' : destructor tag mismatch c:\program files\microsoft visual studio 8\vc\include\xlocale(169) : error C2146: syntax error : missing ')' before identifier '_Initrefs' c:\program files\microsoft visual studio 8\vc\include\xlocale(169) : error C2146: syntax error : missing ';' before identifier '_Initrefs' c:\program files\microsoft visual studio 8\vc\include\xlocale(169) : error C2071: 'std::locale::size_t' : illegal storage class c:\program files\microsoft visual studio 8\vc\include\xlocale(169) : error C2059: syntax error : ')' c:\program files\microsoft visual studio 8\vc\include\xlocale(169) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft visual studio 8\vc\include\xlocale(169) : error C2864: 'std::locale::_Initrefs' : only static const integral data members can be initialized within a class and it goes on and on................................... I'm using visual C++ 2005 Express Edition. Any help will be really appreciated.