microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.85k stars 6.3k forks source link

[directxtk] Build error #31737

Closed g1r4ff3 closed 1 year ago

g1r4ff3 commented 1 year ago

Operating system

x64-windows

Compiler

MSVC 19.36.32532.0

Steps to reproduce the behavior

vcpkg install directxtk:x64-windows

Failure logs

-- Note: directxtk only supports static library linkage. Building static library.
-- Using cached Microsoft-DirectXTK-apr2023.tar.gz.
-- Cleaning sources at C:/Users/USER/vcpkg/buildtrees/directxtk/src/apr2023-6ee4461477.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/Users/USER/vcpkg/downloads/Microsoft-DirectXTK-apr2023.tar.gz
-- Using source at C:/Users/USER/vcpkg/buildtrees/directxtk/src/apr2023-6ee4461477.clean
-- Found external ninja('1.11.0').
-- Configuring x64-windows
-- Building x64-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: "C:/Program Files/CMake/bin/cmake.exe" --build . --config Debug --target install -- -v -j17
    Working Directory: C:/Users/USER/vcpkg/buildtrees/directxtk/x64-windows-dbg
    See logs for more information:
      C:\Users\USER\vcpkg\buildtrees\directxtk\install-x64-windows-dbg-out.log

Call Stack (most recent call first):
  installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
  installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
  ports/directxtk/portfile.cmake:32 (vcpkg_cmake_install)
  scripts/ports.cmake:147 (include)
C:\Users\USER\vcpkg\buildtrees\directxtk\install-x64-windows-dbg-out.log ``` [0/42] cmd.exe /C "cd /D C:\Users\USER\vcpkg\buildtrees\directxtk\src\apr2023-6ee4461477.clean\Src\Shaders && "C:\Program Files\CMake\bin\cmake.exe" -E env CompileShadersOutput="C:/Users/USER/vcpkg/buildtrees/directxtk/x64-windows-dbg/Shaders/Compiled" CompileShaders.cmd > C:/Users/USER/vcpkg/buildtrees/directxtk/x64-windows-dbg/Shaders/Compiled/compileshaders.log" [2/42] C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1436~1.325\bin\Hostx64\x64\cl.exe /TP -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0601 -D_WIN7_PLATFORM_UPDATE -IC:\Users\USER\vcpkg\buildtrees\directxtk\x64-windows-dbg\Shaders\Compiled -IC:\Users\USER\vcpkg\buildtrees\directxtk\src\apr2023-6ee4461477.clean\Src -IC:\Users\USER\vcpkg\buildtrees\directxtk\src\apr2023-6ee4461477.clean\Inc -external:IC:\Users\USER\vcpkg\installed\x64-windows\include\directxmath -external:W0 /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 -std:c++17 -MDd /Wall /GR /fp:fast /sdl /permissive- /JMC- /Zc:__cplusplus /Zc:inline /ZH:SHA_256 /Zc:preprocessor /wd5105 /Zc:lambda /Zc:templateScope /Zc:checkGwOdr /wd5262 /YcC:/Users/USER/vcpkg/buildtrees/directxtk/x64-windows-dbg/CMakeFiles/DirectXTK.dir/cmake_pch.hxx /FpC:/Users/USER/vcpkg/buildtrees/directxtk/x64-windows-dbg/CMakeFiles/DirectXTK.dir/./cmake_pch.cxx.pch /FIC:/Users/USER/vcpkg/buildtrees/directxtk/x64-windows-dbg/CMakeFiles/DirectXTK.dir/cmake_pch.hxx /showIncludes /FoCMakeFiles\DirectXTK.dir\cmake_pch.cxx.obj /FdCMakeFiles\DirectXTK.dir\DirectXTK.pdb /FS -c C:\Users\USER\vcpkg\buildtrees\directxtk\x64-windows-dbg\CMakeFiles\DirectXTK.dir\cmake_pch.cxx FAILED: CMakeFiles/DirectXTK.dir/cmake_pch.cxx.obj C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1436~1.325\bin\Hostx64\x64\cl.exe /TP -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0601 -D_WIN7_PLATFORM_UPDATE -IC:\Users\USER\vcpkg\buildtrees\directxtk\x64-windows-dbg\Shaders\Compiled -IC:\Users\USER\vcpkg\buildtrees\directxtk\src\apr2023-6ee4461477.clean\Src -IC:\Users\USER\vcpkg\buildtrees\directxtk\src\apr2023-6ee4461477.clean\Inc -external:IC:\Users\USER\vcpkg\installed\x64-windows\include\directxmath -external:W0 /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 -std:c++17 -MDd /Wall /GR /fp:fast /sdl /permissive- /JMC- /Zc:__cplusplus /Zc:inline /ZH:SHA_256 /Zc:preprocessor /wd5105 /Zc:lambda /Zc:templateScope /Zc:checkGwOdr /wd5262 /YcC:/Users/USER/vcpkg/buildtrees/directxtk/x64-windows-dbg/CMakeFiles/DirectXTK.dir/cmake_pch.hxx /FpC:/Users/USER/vcpkg/buildtrees/directxtk/x64-windows-dbg/CMakeFiles/DirectXTK.dir/./cmake_pch.cxx.pch /FIC:/Users/USER/vcpkg/buildtrees/directxtk/x64-windows-dbg/CMakeFiles/DirectXTK.dir/cmake_pch.hxx /showIncludes /FoCMakeFiles\DirectXTK.dir\cmake_pch.cxx.obj /FdCMakeFiles\DirectXTK.dir\DirectXTK.pdb /FS -c C:\Users\USER\vcpkg\buildtrees\directxtk\x64-windows-dbg\CMakeFiles\DirectXTK.dir\cmake_pch.cxx C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(835): error C7527: 'RuntimeClassFlagsT': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(831): note: see previous definition of 'RuntimeClassFlagsT' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(869): note: see reference to class template instantiation 'Microsoft::WRL::Details::ImplementsHelper' being compiled C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(835): error C7527: 'doStrictCheck': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(830): note: see previous definition of 'doStrictCheck' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(835): error C7527: 'TInterfaces': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(831): note: see previous definition of 'TInterfaces' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(885): error C7527: 'RuntimeClassFlagsT': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(881): note: see previous definition of 'RuntimeClassFlagsT' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(920): note: see reference to class template instantiation 'Microsoft::WRL::Details::ImplementsHelper,TInterfaces...>' being compiled C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(885): error C7527: 'doStrictCheck': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(880): note: see previous definition of 'doStrictCheck' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(885): error C7527: 'TInterfaces': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(881): note: see previous definition of 'TInterfaces' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(930): error C7527: 'RuntimeClassFlagsT': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(926): note: see previous definition of 'RuntimeClassFlagsT' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(965): note: see reference to class template instantiation 'Microsoft::WRL::Details::ImplementsHelper,I1,TInterfaces...>' being compiled C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(930): error C7527: 'doStrictCheck': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(925): note: see previous definition of 'doStrictCheck' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(930): error C7527: 'TInterfaces': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(926): note: see previous definition of 'TInterfaces' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(971): error C7527: 'RuntimeClassFlagsT': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(968): note: see previous definition of 'RuntimeClassFlagsT' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1000): note: see reference to class template instantiation 'Microsoft::WRL::Details::ImplementsHelper>' being compiled C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(971): error C7527: 'doStrictCheck': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(967): note: see previous definition of 'doStrictCheck' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1007): error C7527: 'RuntimeClassFlagsT': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1005): note: see previous definition of 'RuntimeClassFlagsT' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1028): note: see reference to class template instantiation 'Microsoft::WRL::Details::ImplementsHelper' being compiled C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1007): error C7527: 'doStrictCheck': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1004): note: see previous definition of 'doStrictCheck' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1036): error C7527: 'RuntimeClassFlagsT': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1032): note: see previous definition of 'RuntimeClassFlagsT' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1071): note: see reference to class template instantiation 'Microsoft::WRL::Details::ImplementsHelper,TInterfaces...>' being compiled C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1036): error C7527: 'doStrictCheck': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1031): note: see previous definition of 'doStrictCheck' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1036): error C7527: 'TInterfaces': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1032): note: see previous definition of 'TInterfaces' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1081): error C7527: 'RuntimeClassFlagsT': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1076): note: see previous definition of 'RuntimeClassFlagsT' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1117): note: see reference to class template instantiation 'Microsoft::WRL::Details::ImplementsHelper,TInterfaces...>' being compiled C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1081): error C7527: 'doStrictCheck': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1075): note: see previous definition of 'doStrictCheck' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1081): error C7527: 'TInterfaces': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1076): note: see previous definition of 'TInterfaces' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1143): error C7527: 'RuntimeClassFlagsT': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1140): note: see previous definition of 'RuntimeClassFlagsT' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1174): note: see reference to class template instantiation 'Microsoft::WRL::Details::ImplementsHelper,TInterfaces...>' being compiled C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1143): error C7527: 'doStrictCheck': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1139): note: see previous definition of 'doStrictCheck' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1143): error C7527: 'TInterfaces': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1140): note: see previous definition of 'TInterfaces' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1179): error C7527: 'RuntimeClassFlagsT': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1177): note: see previous definition of 'RuntimeClassFlagsT' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1256): note: see reference to class template instantiation 'Microsoft::WRL::Details::ImplementsHelper>' being compiled C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1179): error C7527: 'doStrictCheck': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1176): note: see previous definition of 'doStrictCheck' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1277): error C7527: 'TInterfaces': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1268): note: see previous definition of 'TInterfaces' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1299): note: see reference to class template instantiation 'Microsoft::WRL::Implements' being compiled C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1312): error C7527: 'TInterfaces': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1302): note: see previous definition of 'TInterfaces' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\implements.h(1334): note: see reference to class template instantiation 'Microsoft::WRL::Implements,I0,TInterfaces...>' being compiled C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\event.h(238): error C7527: 'TDelegateInterface': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\event.h(236): note: see previous definition of 'TDelegateInterface' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\event.h(256): note: see reference to class template instantiation 'Microsoft::WRL::Details::DelegateArgTraits' being compiled C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\event.h(238): error C7527: 'TArgs': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\event.h(236): note: see previous definition of 'TArgs' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\event.h(250): error C7527: 'TDelegateInterface': a template parameter name cannot be reused within its scope C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt\wrl\event.h(236): note: see previous definition of 'TDelegateInterface' ninja: build stopped: subcommand failed. ```

Additional context

No response

FrankXie05 commented 1 year ago

@g1r4ff3 Thanks for posting this issue, could you please install the latest sdk version and try again? image

g1r4ff3 commented 1 year ago

@FrankXie05 As you said, i updated windows 10 sdk to the latest and installed windows 11 sdk, the problem has been resolved! Thank you.

walbourn commented 1 year ago

The failure here is due to the combination of using the "19.36.32532.0" (i.e. Visual Studio 2022 17.6) compiler with the older Windows SDK. In recent versions of DirectX Tool Kit, I enabled some additional conformance switches when using the new complier. It appears that /Zc:templateScope is not compatible with older Windows SDKs. I'll look at updating the CMakeLists to not use that switch with SDKs prior to 22000.