我正在尝试使用 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/