使用 python 编译引脚工具的错误包括,得到错误 C2872:'UINT32':不明确的符号

Errors compiling pin tool with python includes, getting error C2872: 'UINT32' : ambiguous symbol

本文关键字:错误 符号 不明确 UINT32 C2872 引脚 编译 python 工具 包括 使用      更新时间:2023-10-16

我正试图用Python.h编译pin工具,但收到了100多个关于不明确符号的错误。

我试图将include分离到不同的命名空间,但它产生了许多其他错误。

包括windows.h时也会发生同样的情况。

所有的错误看起来像:

D:projPinsourceincludepingentypes_core.TLH(67): error C2872: 'INT32' : ambiguous symbol could be 'C:Program Files (x86)Windows Kits8.0Includesharedbasetsd.h(72) : int INT32 or D:projpinPinsourceincludepingentypes_foundation.TLH(88) : LEVEL_BASE::INT32' D:projpinPinsourceincludepingentypes_core.TLH(81) : see reference to class template instantiation 'LEVEL_CORE::INDEX<dummy>' being compiled

你知道这个问题的快速解决方案吗?

谢谢!

如果你想使用Windows.h标头,你必须在它自己的命名空间中使用它:

namespace WINDOWS
{
    #include <Windows.h>
}

然后使用Windows.h中的名称空间:

WINDOWS::DWORD foo; // use WINDOWS namespace

如果你不为windows.h标头使用名称空间,你将从PIN本身获得大量与各种标头的名称冲突。

编辑

我只记得在手册的某个地方提到了这一点(请参阅:"Pin和Windows之间的冲突"(:

https://software.intel.com/sites/landingpage/pintool/docs/65163/Pin/html/index.html#RESTRICTIONS