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

▼魔方 西西 提交于 2019-12-19 10:25:24

问题


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!


回答1:


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



来源:https://stackoverflow.com/questions/28024164/errors-compiling-pin-tool-with-python-includes-getting-error-c2872-uint32

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!