使用 python 编译 pin 工具时出错,出现错误 C2872:'UINT32':符号不明确
Errors compiling pin tool with python includes, getting error C2872: 'UINT32' : ambiguous symbol
我正在尝试使用 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.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 发生大量名称冲突。
编辑:
刚记起来在手册的某处提到过(参见:"Conflicts between Pin and Windows"):
https://software.intel.com/sites/landingpage/pintool/docs/65163/Pin/html/index.html#RESTRICTIONS
我正在尝试使用 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.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 发生大量名称冲突。
编辑:
刚记起来在手册的某处提到过(参见:"Conflicts between Pin and Windows"):
https://software.intel.com/sites/landingpage/pintool/docs/65163/Pin/html/index.html#RESTRICTIONS