python - 使用 python 编译 pin 工具时出错,出现错误 C2872 : 'UINT32' : ambiguous symbol

标签 python c++ visual-studio compiler-errors intel-pin

我正在尝试使用 Python.h 编译 pin 工具并且收到超过 100 个关于不明确符号的错误。

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

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

所有错误看起来像:

D:\proj\Pin\source\include\pin\gen\types_core.TLH(67): error C2872: 'INT32' : ambiguous symbol could be 'C:\Program Files (x86)\Windows Kits\8.0\Include\shared\basetsd.h(72) : int INT32 or D:\proj\pin\Pin\source\include\pin\gen\types_foundation.TLH(88) : LEVEL_BASE::INT32' D:\proj\pin\Pin\source\include\pin\gen\types_core.TLH(81) : see reference to class template instantiation 'LEVEL_CORE::INDEX<dummy>' being compiled

您知道这个问题的快速修复方法吗?

谢谢!

最佳答案

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

namespace WINDOWS
{
    #include <Windows.h>
}

然后通过命名空间使用 Windows.h 中的内容:

WINDOWS::DWORD foo; // use WINDOWS namespace

如果您不为 windows.h header 使用命名空间,您将与 PIN 本身的各种 header 发生大量名称冲突。

编辑:

只是记得在手册的某处提到过(参见:“Pin 和 Windows 之间的冲突”):

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

关于python - 使用 python 编译 pin 工具时出错,出现错误 C2872 : 'UINT32' : ambiguous symbol,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28024164/

相关文章:

python - 将轮廓(MatplotLib 或 OpenCV)转换为与原始图像大小相同的图像

python - 在嵌套列表中查找和分组相同的值(浮点向量)

c++ - 在没有 "save"方法的情况下序列化大型结构

c++ - 多个项目引用 MFC : "use mfc in a static library" vs "use mfc in a shared dll"?

c# - 不再在 docker 中使用 dotnet watch 的理由是什么

python - NER 标记器的替代品用于长的、异构的短语?

python - 计算图的顶点对上函数的双重求和值

c++ - Armadillo 库如何处理错误?

c++ - 多个子目录的 Makefile 模式规则

c# - 禁止不带代码的警告