【问题标题】:Including <d3dkmthk.h> causes errors 'E0090 function returning function is not allowed'包含 <d3dkmthk.h> 会导致错误 'E0090 function returned function is not allowed'
【发布时间】:2019-03-10 16:38:12
【问题描述】:

在 Visual Studio 上的 x64 dll 项目中,添加以下行:

#include &lt;d3dkmthk.h&gt;

给了我数百个类似这样的错误:

Error (active)    E0090    function returning function is not allowed
Error    C2059    syntax error: '__cdecl'
Error    C2143    syntax error: missing ';' before '__cdecl'
Error    C4430    missing type specifier - int assumed. Note: C++ does not support default-int

【问题讨论】:

  • 您的问题是 C++ 问题,而不是 C。这也是 MCVE 吗?
  • 我想你是对的,我在真正得到答案之前就写了这个问题,这导致我添加了最终不必要的信息。

标签: c++ visual-studio dll directx


【解决方案1】:

问题是由#define WIN32_LEAN_AND_MEAN引起的,删除此行即可解决问题。

【讨论】:

  • #include &lt;d3dkmthk.h&gt; 是 Windows Driver Kit 中的内核模式标头。您不应该在用户模式程序中使用它。
  • 我正在写一个directx绕道,导入它允许我在我的包装函数中使用一些结构。
猜你喜欢
  • 2022-11-20
  • 2012-04-26
  • 1970-01-01
  • 2018-11-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多