http://social.msdn.microsoft.com/forums/en-US/vclanguage/thread/66b85455-d667-44dc-adcb-1e1d2aa6f50b
找到了这里
Never mind. The cause of the problem has been found. The identifier "_DebugHeapTag_func" is used in the "xdebug" file line 27 to define "_NEW_CRT" as "new(std::_DebugHeapTag_func(), __FILE__, __LINE__)". The problem turned out to be that somewhere else in the project, the "new" function was redefined to a format not compatible with "std::_DebugHeapTag_func". Once the redefinition of "new" was removed, the problem was gone.All hints from the experts in this thread are very helpful and greatly appreciated. Thanks.
这段话...
貌似也没说怎么解决啊哪位大哥遇到过类似的问题?
下面是详细的出错日志:
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocmon(283) : error C2061: 语法错误 : 标识符“_DebugHeapTag_func”
1>        c:\program files\microsoft visual studio 9.0\vc\include\xlocmon(281): 编译类 模板 成员函数“size_t std::moneypunct<_Elem,_Intl>::_Getcat(const std::locale::facet **,const std::locale *)”时
1>        with
1>        [
1>            _Elem=char,
1>            _Intl=true
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\xlocmon(908): 参见对正在编译的类 模板 实例化“std::moneypunct<_Elem,_Intl>”的引用
1>        with
1>        [
1>            _Elem=char,
1>            _Intl=true
1>        ]
1>URLDlg.cpp
1>RepositoryBar.cpp
1>RepoDrags.cpp
1>RenameDlg.cpp
1>正在生成代码...
1>正在编译...
1>Blame.cpp
1>BlameDlg.cpp
1>EditPropConflictDlg.cpp
1>EditPropertiesDlg.cpp
1>EditPropertyValueDlg.cpp
1>AddDlg.cpp
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocmon(283) : error C2061: 语法错误 : 标识符“_DebugHeapTag_func”
1>        c:\program files\microsoft visual studio 9.0\vc\include\xlocmon(281): 编译类 模板 成员函数“size_t std::moneypunct<_Elem,_Intl>::_Getcat(const std::locale::facet **,const std::locale *)”时
1>        with
1>        [
1>            _Elem=char,
1>            _Intl=true
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\xlocmon(908): 参见对正在编译的类 模板 实例化“std::moneypunct<_Elem,_Intl>”的引用
1>        with
1>        [
1>            _Elem=char,
1>            _Intl=true
1>        ]
1>LogDlgHelper.cpp
1>CopyDlg.cpp
1>正在生成代码...
1>生成日志保存在“file://e:\SourceCode\FileBank\FileBank\Debug\BuildLog.htm”
1>FileBank - 2 个错误,3 个警告
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========

解决方案 »

  1.   


    检查一下程序中有没有自己定义 new (not compatible with "std::_DebugHeapTag_func")
      

  2.   

    找了一大圈 没有找到 operator new 郁闷...........................
      

  3.   

    不需要找 operator new 一般在文件的头部,类似这样
    #ifdef _DEBUG
    #define new DEBUG_NEW
    #endif
      

  4.   

    找到报告错误时正在编译的你的cpp文件。如AddDlg.cpp。调整他和他的头文件的 include 的顺序。你的工程有两个cpp文件导致了同一个错误,根据这两个文件共同点(包含的头文件),很容易找出问题的所在。
      

  5.   

    up
    如果是MFC程序的话,自动生成的cpp文件都有这个,跟stl里面的冲突了,把这个注释掉应该就可以了
      

  6.   

    根据错误的cpp文件,查看他们的h等文件,是否重复定义了,自己仔细对比查找两个错误的文件
      

  7.   

    根据错误的cpp文件,查看他们的h等文件,是否重复定义了,自己仔细对比查找两个错误的文件  
     
      

  8.   

    今天碰到同样问题。我用Boost,然后把#include <boost/XXX>放在Cpp文档中间(不是文档头部),就报了上面的错error C2061: 语法错误 : 标识符“_DebugHeapTag_func”。
    当我把#include <boost/XXX>放在.H文件里,就不报错了。