【问题标题】:C++ Visual studio 2012 error C3861: '_T': identifier not found?C++ Visual Studio 2012 错误 C3861:'_T':找不到标识符?
【发布时间】:2014-02-07 12:57:08
【问题描述】:

我在 64 位 windows 7 上安装了 Visual Studio 2012,并尝试构建 MFC 项目,但在第一次调试时总是出现错误:

Error   1   error C3861: '_T': identifier not found c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atlexcept.h   66
Error   3   error C3861: '_T': identifier not found c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atlcomcli.h   556
Error   4   error C3861: '_T': identifier not found c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atlcomcli.h   589
...

必须在哪里定义那些 _T 宏?为什么会出现这些问题?

【问题讨论】:

  • 你只需要#include
  • 如果头文件中出现错误,你的意思是把#include 放在哪里...?
  • 将它包含在你的头文件中。
  • 很遗憾什么也没发生

标签: visual-studio-2012 unicode macros mfc


【解决方案1】:

#include <tchar.h> 应该可以工作。如果不是..然后尝试这样做;

#ifdef _UNICODE
#define _T(x)      L ## x
#else /* _UNICODE */
#define _T(x)      x
#endif /* _UNICODE */

【讨论】:

  • 我放弃了对努力的投票,但在我的确切示例中这些都不起作用
  • 您能否分享您收到此错误消息的部分代码。如果您提供更多信息,那么我们可能会理解您收到错误的原因。
  • 所有其他错误都与发布的相同,问题出现在默认 c++ 头文件中(在任何编译开始之前处理)所以我正在寻找 Visual Studio 层的解决方案,我应该安装它再次修复仅在一个标题中插入您的代码的标题...
  • 不只是带有头文件的基本 mfc 应用程序,我发现问题出现在 Visual Studio 的某个地方...
猜你喜欢
  • 2011-04-11
  • 1970-01-01
  • 2013-03-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-12-31
  • 1970-01-01
相关资源
最近更新 更多