1

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!

Moshe
  • 9,283
  • 4
  • 29
  • 38
ProgDude
  • 21
  • 3

1 Answers1

-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

Neitsa
  • 7,693
  • 1
  • 28
  • 45
  • It would be a hell redefining all the PIN or Python references to UINT32... There must be a better way to do it. – user1618465 Nov 20 '15 at 01:25
  • @user1618465 I think you misunderstood my answer or the PIN ducumentation: you don't have to redefine the types **inside** PIN, Windows or python headers (or whatever). Just use a namespace in **your** Pintool. That's completely different... – Neitsa Nov 20 '15 at 08:18