错误编译pin工具与python包括,得到错误C2872:'UINT32':模糊符号 [英] Errors compiling pin tool with python includes, getting error C2872: 'UINT32' : ambiguous symbol

查看:709
本文介绍了错误编译pin工具与python包括,得到错误C2872:'UINT32':模糊符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用 Python.h 编译pin工具,并得到多于100个有关模糊符号的错误。



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



当包含 windows.h



所有错误如下所示:



D:\proj\Pin\source\include\pin\gen\types_core.TLH(67):error C2872:'INT32':模糊符号是C:\Program Files(x86)\Windows Kits\8.0\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' \include\pin\gen\types_foundation.TLH(88):LEVEL_BASE :: INT32'D:\proj\pin\Pin\source\include\pin\gen\types_core。 TLH(81):
参见类模板实例化'LEVEL_CORE :: INDEX< dummy>'正在编译



如何解决这个问题?



谢谢!

解决方案

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

 命名空间WINDOWS 
{
#include< Windows.h>
}

然后使用来自Windows.h的命名空间:

  WINDOWS :: DWORD foo; //使用WINDOWS命名空间

如果你不使用命名空间作为windows.h头文件,



编辑

p>刚刚记住的是手册上提到的地方(见:Pin和Windows之间的冲突):



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


I'm trying to compile pin tool with Python.h and am getting more then 100 errors about ambiguous symbols.

I tried to separate the include to different namespace but it generated many other errors.

Same happens when including windows.h.

All the errors looks like:

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

Do you know about a quick fix for this issue?

Thanks!

解决方案

If you want to use the Windows.h header you must use it in its own namespace:

namespace WINDOWS
{
    #include <Windows.h>
}

And then use something from Windows.h by using its namespace:

WINDOWS::DWORD foo; // use WINDOWS namespace

If you don't use a namespace for the windows.h header you'll get tons of name collisions with various headers from PIN itself.

edit:

Just remembered that is was mentioned somewhere on the manual (see: "Conflicts between Pin and Windows"):

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

这篇关于错误编译pin工具与python包括,得到错误C2872:'UINT32':模糊符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆