简体   繁体   English

VS2015 / 2017 中的 TRACE 宏无法编译 - 我需要包含什么?

[英]TRACE Macro in VS2015 / 2017 wont compile - what do i need to include?

I have an SDK for some Hardware I need to implement我有一些需要实现的硬件的 SDK
I use The MFC Class they provide and created a windows console application.我使用他们提供的 MFC 类并创建了一个 Windows 控制台应用程序。 They heavily rely on the Trace Macro so i cant simply comment them out.他们严重依赖跟踪宏,所以我不能简单地将它们注释掉。

  • I already manually installed the ATL + MFC Component for visual C++我已经手动安装了 Visual C++ 的 ATL + MFC 组件

  • I installed the 2015 Compiler (as i read they changed something ...)我安装了 2015 Compiler(当我读到他们改变了一些东西......)

  • I disabled precompiled headers我禁用了预编译头

  • I tried "switching" some options in Project properties, but that did not yield anything different :(我尝试“切换”项目属性中的一些选项,但这并没有产生任何不同:(

    TRACE(_T("PS10DLL not found\\n")); TRACE(_T("找不到PS10DLL\\n"));

I would expect to compile smoothly but the Error (they used it alot) is:我希望能够顺利编译,但错误(他们经常使用它)是:
error C3861: "TRACE": Identifier was not found.

According to your issue, you are creating a windows console application?根据您的问题,您正在创建 Windows 控制台应用程序? TRACE is used in the MFC support program and cannot be used in the WIN32 Application program. TRACE 用于 MFC 支持程序,不能用于 WIN32 应用程序。

TRACE is a definition in MFC. TRACE 是 MFC 中的定义。 In Win32 code, you can directly use OutputDebugString to achieve the same effect.在 Win32 代码中,可以直接使用OutputDebugString来达到同样的效果。

I suggest you could refer to the link: How can I use the TRACE macro in non-MFC projects?我建议您可以参考以下链接: 如何在非 MFC 项目中使用 TRACE 宏?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM