intel / pcm

Intel® Performance Counter Monitor (Intel® PCM)
BSD 3-Clause "New" or "Revised" License
2.81k stars 476 forks source link

Cannot Compile Windows MSR #871

Open aaronsuydam opened 1 week ago

aaronsuydam commented 1 week ago

Hey yall, no matter what I do, I cannot seem to get the windows MSR to compile from source. Here is the error, having followed the instructions exactly. Which were, download the source code, install the windows SDK and windows driver kit, then run this command : MSBuild.exe MSR.vcxproj -property:Configuration=Release -property:Platform=x64

I have tried updating the include path, but it only gives me more errors....

This is the error:


MSBuild version 17.11.9+a69bbaaf5 for .NET Framework
Build started 11/6/2024 23:06:47.

Project "C:\Users\suyda\OneDrive\Documents\Downloads\pcm-202409\pcm-202409\src\WinMSRDriver\MSR.vcxproj" on node 1 (def
ault targets).
PrepareForBuild:
  Creating directory "MSR\x64\Release\".
  Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://ak
  a.ms/cpp/structured-output for more details.
  Creating directory "C:\Users\suyda\OneDrive\Documents\Downloads\pcm-202409\pcm-202409\src\WinMSRDriver\x64\Release\".
  Creating directory "MSR\x64\Release\MSR.tlog\".
InitializeBuildStatus:
  Creating "MSR\x64\Release\MSR.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
  Touching "MSR\x64\Release\MSR.tlog\unsuccessfulbuild".
ClCompile:
  C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\CL.exe /c /Zi /nolo
  go /W1 /WX- /diagnostics:column /O2 /Gm- /EHsc /MD /GS /Qspectre /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"MSR\x64\Rele
  ase\\" /Fd"MSR\x64\Release\vc143.pdb" /external:W1 /Gd /TC /FC /errorReport:queue msrmain.c
  msrmain.c
C:\Users\suyda\OneDrive\Documents\Downloads\pcm-202409\pcm-202409\src\WinMSRDriver\msr.h(12,10): error C1083: Cannot op
en include file: 'ntifs.h': No such file or directory [C:\Users\suyda\OneDrive\Documents\Downloads\pcm-202409\pcm-20240
9\src\WinMSRDriver\MSR.vcxproj]
  (compiling source file 'msrmain.c')

Done Building Project "C:\Users\suyda\OneDrive\Documents\Downloads\pcm-202409\pcm-202409\src\WinMSRDriver\MSR.vcxproj"
(default targets) -- FAILED.

Build FAILED.

"C:\Users\suyda\OneDrive\Documents\Downloads\pcm-202409\pcm-202409\src\WinMSRDriver\MSR.vcxproj" (default target) (1) -
>
(ClCompile target) ->
  C:\Users\suyda\OneDrive\Documents\Downloads\pcm-202409\pcm-202409\src\WinMSRDriver\msr.h(12,10): error C1083: Cannot
open include file: 'ntifs.h': No such file or directory [C:\Users\suyda\OneDrive\Documents\Downloads\pcm-202409\pcm-202
409\src\WinMSRDriver\MSR.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.68```
aaronsuydam commented 5 days ago

Update, after opening the vcxproj in visual studio and manually specifying the location of the WDK include files, and adding a preprocessor definition to specify the target architecture, it compiles, however, the msr.sys file is not generated. I know next to nothing about Windows Driver development.