[format] error when used with DEBUG_NEW in VC7.1 MFC

when i comment these codes ,it will be OK. #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ////////////////////souce code #include <iostream> #include <tchar.h> #define WIN32_LEAN_AND_MEAN // #pragma warning(disable:4200) // nonstandard extension used : zero-sized array in struct/union #pragma warning(disable:4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data #pragma warning(disable:4800) // 'type' : forcing value to bool 'true' or 'false' (performance warning) // Windows Header Files: #ifndef WINVER #define WINVER 0x0400 // 0x0400 == Windows 98 and Windows NT 4.0 (because of '_WIN32_WINDOWS=0x0410') #endif #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0400 // 0x0400 == Windows NT 4.0 #endif #ifndef _WIN32_WINDOWS #define _WIN32_WINDOWS 0x0410 // 0x0410 == Windows 98 #endif #ifndef _WIN32_IE #define _WIN32_IE 0x0400 // 0x0400 == Internet Explorer 4.0 -> Comctl32.dll v4.71 #endif #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS #define _AFX_ALL_WARNINGS #include <afxwin.h> #include <afxext.h> #include <afxdisp.h> //#include <afxdtctl.h> #ifndef _AFX_NO_AFXCMN_SUPPORT #include <afxcmn.h> #endif // _AFX_NO_AFXCMN_SUPPORT #include <winsock2.h> #define _WINSOCKAPI_ #include <afxsock.h> #include <afxdhtml.h> #include <afxmt.h> #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif #include <boost/format.hpp> void ipAddressToString(const unsigned int ip, std::string &str) { //char temp[64]; //_snprintf(temp,sizeof(temp),"%ld.%ld.%ld.%ld", // ((ip >> 24) & 0xFF), // ((ip >> 16) & 0xFF), // ((ip >> 8) & 0xFF), // ((ip ) & 0xFF) ); //str = temp; str = boost::str( boost::format("%ld.%ld.%ld.%ld") % ((ip >> 24) & 0xFF) % ((ip >> 16) & 0xFF) % ((ip >> 8) & 0xFF) % ((ip ) & 0xFF) ); } class A {}; int _tmain(int argc, _TCHAR* argv[]) { std::string str; ipAddressToString(0xf1c2d3e4,str); int *p = new int(32); // A *q = new(p)(A); return 0; } ////////////////////////errors e:\boost_1_35_0\boost\optional\optional.hpp(315) : error C2061: syntax error : identifier 'm_storage' e:\boost_1_35_0\boost\optional\optional.hpp(314) : while compiling class-template member function 'void boost::optional_detail::optional_base<T>::construct(boost::optional_detail::optional_base<T>::argument_type)' with [ T=boost::io::detail::locale_t ] e:\boost_1_35_0\boost\optional\optional.hpp(455) : see reference to class template instantiation 'boost::optional_detail::optional_base<T>' being compiled with [ T=boost::io::detail::locale_t ] e:\boost_1_35_0\boost\format\internals.hpp(56) : see reference to class template instantiation 'boost::optional<T>' being compiled with [ T=boost::io::detail::locale_t ] e:\boost_1_35_0\boost\format\internals.hpp(57) : see reference to class template instantiation 'boost::io::detail::stream_format_state<Ch,Tr>' being compiled Build log was saved at "file://c:\Documents and Settings\jiang\桌面\Voip\kademlia\Debug\BuildLog.htm" Kad - 1 error(s), 1 warning(s)
participants (1)
-
hongleij