hasherezade / tiny_tracer

A Pin Tool for tracing API calls etc
1.29k stars 141 forks source link

Cannot compile the project: Reference to std::size_t is ambiguous #62

Closed acheron2302 closed 2 months ago

acheron2302 commented 2 months ago

Operating System: Windows 11 Pro version 23H2 Visual Studio version: 17.11.1 (2022) MSVC version: 143 Windows SDK version: 10.0.22621 Visual studio can't compile the code, I have put it into pin/source/tools. There are 365 error but one of them is size_t is ambiguous.

I think the main reason is that it conflict with the pin predefined. image

hasherezade commented 2 months ago

hi @acheron2302 ! Check out the changes in the new branch: https://github.com/hasherezade/tiny_tracer/tree/explicit_std and let me know if it is ok now. Regarding:

Visual studio can't compile the code, I have put it into pin/source/tools.

This is normal and documented behavior.

acheron2302 commented 2 months ago

Thanks for your quick response, I have modified some other places to use std::size_t but after modify all of them, there are still error with std::setw image

acheron2302 commented 2 months ago

ok update even after remove std::setw. I still get a lot of error, I think the reason because compiler get conflict with each other

hasherezade commented 2 months ago

@acheron2302 - I updated the branch and fixed the remaining size_t -> std::size_t. Either way, what you are describing looks weird, I cannot reproduce this problem. You can see that I also use VS2022 on AppVeyor, and it builds without errors. Maybe there is something wrong with your compiler settings? Can you delete the full source, download the last supported PIN (this one: https://software.intel.com/sites/landingpage/pintool/downloads/pin-external-3.31-98861-g71afcc22f-msvc-windows.zip) , and try again, following exactly the steps that are described on Wiki? https://github.com/hasherezade/tiny_tracer/wiki/Installation

acheron2302 commented 2 months ago

Here is the log of the fail compile and the cl compile, most of the compile error is from the standard library so maybe the compiler is broken some where. TinyTracer.log

CL.command.1.txt

hasherezade commented 2 months ago

@acheron2302 - did you try to pull everything from scratch?

acheron2302 commented 2 months ago

Oh thanks after I redownload it the code compile now didn't pull everything from scratch but just copy and paste the last time