Closed marovira closed 3 weeks ago
@marovira you say "In Windows 11 Pro, I am able to compile with any of the aforementioned prompts."
Are you saying that you are NOT able to compile. I seems it is something in your environment causing the error. Can you attach the output of env
command?
@marovira you say "In Windows 11 Pro, I am able to compile with any of the aforementioned prompts." Are you saying that you are NOT able to compile. I seems it is something in your environment causing the error. Can you attach the output of
env
command?
Just to clarify:
I will send the env
output tomorrow. Do you want me to send it for a particular prompt? If so, which one(s)?
Please send it from x64 Native Tools Command Prompt for VS 2022.
Here's the output for env
on the x64 Native Tools Command Prompt for VS 2022:
C:\Program Files\Microsoft Visual Studio\2022\Enterprise>env
!C:=C:\Program Files\Microsoft Visual Studio\2022\Enterprise
!ExitCode=00000000
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\mauriciogalvez\AppData\Roaming
CommandPromptType=Native
COMMONPROGRAMFILES=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=MAURICIO-PC
COMSPEC=C:\Windows\system32\cmd.exe
DevEnvDir=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\
DriverData=C:\Windows\System32\Drivers\DriverData
DXSDK_DIR=C:\Program Files (x86)\Microsoft DirectX 9.0 SDK (October 2005)\
EFC_150940=1
ExtensionSdkDir=C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs
EXTERNAL_INCLUDE=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um
Framework40Version=v4.0
FrameworkDir=C:\Windows\Microsoft.NET\Framework64\
FrameworkDir64=C:\Windows\Microsoft.NET\Framework64\
FrameworkVersion=v4.0.30319
FrameworkVersion64=v4.0.30319
FSHARPINSTALLDIR=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools
HOMEDRIVE=C:
HOMEPATH=\Users\mauriciogalvez
HTMLHelpDir=C:\Program Files (x86)\HTML Help Workshop
INCLUDE=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um
LIB=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.20348.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\\lib\10.0.20348.0\\um\x64
LIBCLANG_PATH=C:\Users\mauriciogalvez\scoop\apps\llvm\current\bin
LIBPATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.20348.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.20348.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319
LLVM_LIB_DIR=C:\Users\mauriciogalvez\scoop\apps\llvm\current\lib
LOCALAPPDATA=C:\Users\mauriciogalvez\AppData\Local
NEOVIDE_FORK=1
NETFXSDKDir=C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\
NUMBER_OF_PROCESSORS=24
OneDrive=C:\Users\mauriciogalvez\OneDrive
OneDriveCommercial=C:\Users\mauriciogalvez\OneDrive
OS=Windows_NT
PAI_MODEL_DIR=C:\ProgramData\Topaz Labs LLC\Topaz Photo AI\models
PATH=/c/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64:/c/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/VC/VCPackages:/c/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/CommonExtensions/Microsoft/TestWindow:/c/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer:/c/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/bin/Roslyn:/c/Program Files (x86)/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.8 Tools/x64:/c/Program Files (x86)/HTML Help Workshop:/c/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/CommonExtensions/Microsoft/FSharp/Tools:/c/Program Files/Microsoft Visual Studio/2022/Enterprise/Team Tools/DiagnosticsHub/Collector:/c/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/Extensions/Microsoft/CodeCoverage.Console:/c/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x64:/c/Program Files (x86)/Windows Kits/10/bin/x64:/c/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/amd64:/c/Windows/Microsoft.NET/Framework64/v4.0.30319:/c/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE:/c/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/Tools:/c/Program Files (x86)/Microsoft DirectX 9.0 SDK (October 2005)/Utilities/Bin/x86:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn:/c/Program Files/Microsoft SQL Server/150/Tools/Binn:/c/Program Files (x86)/Seapine/TestTrack:/c/Program Files (x86)/Windows Kits/8.1/Windows Performance Toolkit:/c/Program Files/dotnet:/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/c/Program Files/Perforce:/cmd:/mingw64/bin:/usr/bin:/c/Users/mauriciogalvez/scoop/apps/vulkan/current/Bin:/c/Users/mauriciogalvez/scoop/apps/vulkan/current/Tools:/c/Users/mauriciogalvez/scoop/apps/python/current/Scripts:/c/Users/mauriciogalvez/scoop/apps/python/current:/c/Users/mauriciogalvez/scoop/apps/python310/current/Scripts:/c/Users/mauriciogalvez/scoop/apps/python310/current:/c/Users/mauriciogalvez/scoop/apps/miktex/current/texmfs/install/miktex/bin/x64:/c/Users/mauriciogalvez/scoop/apps/nodejs/current/bin:/c/Users/mauriciogalvez/scoop/apps/nodejs/current:/c/Users/mauriciogalvez/scoop/apps/llvm/current/bin:/c/Users/mauriciogalvez/scoop/shims:/c/Users/mauriciogalvez/AppData/Local/Microsoft/WindowsApps:/c/Users/mauriciogalvez/AppData/Local/Pandoc:/cmd:/mingw64/bin:/usr/bin:/c/Users/mauriciogalvez/AppData/Local/SumatraPDF:/c/Program Files/kryptex/bin:/c/Program Files/lua/bin:/c/VulkanSDK/1.3.268.0/Bin:/c/Users/mauriciogalvez/.dotnet/tools:/c/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin:/c/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja:/c/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/VC/Linux/bin/ConnectionManagerExe
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
Platform=x64
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD
PROCESSOR_LEVEL=25
PROCESSOR_REVISION=6102
ProgramData=C:\ProgramData
PROGRAMFILES=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PUBLIC=C:\Users\Public
SESSIONNAME=Console
SYSTEMDRIVE=C:
SYSTEMROOT=C:\Windows
TEMP=/tmp
TMP=/tmp
TTPRO_APPDIR=C:\Program Files (x86)\Seapine\TestTrack
UCRTVersion=10.0.20348.0
UniversalCRTSdkDir=C:\Program Files (x86)\Windows Kits\10\
USERNAME=mauriciogalvez
USERPROFILE=C:\Users\mauriciogalvez
VCIDEInstallDir=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\VC\
VCINSTALLDIR=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\
VCToolsInstallDir=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\
VCToolsRedistDir=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.40.33807\
VCToolsVersion=14.41.34120
VisualStudioVersion=17.0
VK_SDK_PATH=C:\Users\mauriciogalvez\scoop\apps\vulkan\current
VS170COMNTOOLS=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\
VSCMD_ARG_app_plat=Desktop
VSCMD_ARG_HOST_ARCH=x64
VSCMD_ARG_TGT_ARCH=x64
VSCMD_VER=17.11.4
VSIDEPATH2022=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\
VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
VULKAN_SDK=C:\Users\mauriciogalvez\scoop\apps\vulkan\current
WINDIR=C:\Windows
WindowsLibPath=C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.20348.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.20348.0
WindowsSdkBinPath=C:\Program Files (x86)\Windows Kits\10\bin\
WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10\
WindowsSDKLibVersion=10.0.20348.0\
WindowsSdkVerBinPath=C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\
WindowsSDKVersion=10.0.20348.0\
WindowsSDK_ExecutablePath_x64=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\
WindowsSDK_ExecutablePath_x86=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\
XDG_CONFIG_HOME=C:\Users\mauriciogalvez\AppData\Local
__DOTNET_ADD_64BIT=1
__DOTNET_PREFERRED_BITNESS=64
__VSCMD_PREINIT_PATH=C:\Program Files (x86)\Microsoft DirectX 9.0 SDK (October 2005)\Utilities\Bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files (x86)\Seapine\TestTrack;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\dotnet\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Perforce\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\mauriciogalvez\scoop\apps\vulkan\current\Bin;C:\Users\mauriciogalvez\scoop\apps\vulkan\current\Tools;C:\Users\mauriciogalvez\scoop\apps\python\current\Scripts;C:\Users\mauriciogalvez\scoop\apps\python\current;C:\Users\mauriciogalvez\scoop\apps\python310\current\Scripts;C:\Users\mauriciogalvez\scoop\apps\python310\current;C:\Users\mauriciogalvez\scoop\apps\miktex\current\texmfs\install\miktex\bin\x64;C:\Users\mauriciogalvez\scoop\apps\nodejs\current\bin;C:\Users\mauriciogalvez\scoop\apps\nodejs\current;C:\Users\mauriciogalvez\scoop\apps\llvm\current\bin;C:\Users\mauriciogalvez\scoop\shims;C:\Users\mauriciogalvez\AppData\Local\Microsoft\WindowsApps;C:\Users\mauriciogalvez\AppData\Local\Pandoc\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\mauriciogalvez\AppData\Local\SumatraPDF\;C:\Program Files\kryptex\bin;C:\Program Files\lua\bin;C:\VulkanSDK\1.3.268.0\Bin;C:\Users\mauriciogalvez\.dotnet\tools
TERM=xterm-256color
HOME=/c/Users/mauriciogalvez
@satyajandhyala did you get a chance to see the output?
Any updates on this issue?
I think it might to relevant to the Windows SDK version you are using. The log you posted has the following information:
-- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.22631.
Could you please compare it in the two different builds, the passed one and the failed one, to see if there is any difference. I suggest using the newest Windows SDK.
I think it might to relevant to the Windows SDK version you are using. The log you posted has the following information:
-- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.22631.
Could you please compare it in the two different builds, the passed one and the failed one, to see if there is any difference. I suggest using the newest Windows SDK.
I have verified it, and it is indeed a problem caused by the Windows SDK version. It appears that the version of WIL used by ONNXRuntime is incompatible with older versions of the Windows SDK.
As a side note, I searched through the official documentation from ONNXRuntime regarding this and I couldn't find any mentions of a minimum Windows SDK version. Perhaps it would be worth adding it?
We recommend using the most recent Windows SDK. I am not sure what the minimum version that works. Sorry I did not test it that much.
That's fair. Thanks for the help!
Describe the issue
When building ONNXRuntime, I get a series of compiler errors saying that
STRSAFE_PCNZCH
, andSTRSAFE_LPSTR
are not defined. The issue is reproducible in Windows 11 Enterprise, though I am unable to reproduce it in Windows 11 Pro.The compiler error appears in Windows 11 Enterprise regardless of the environment in which it is launched. I can reliably reproduce it in any of the following:
In Windows 11 Pro, I am able to compile with any of the aforementioned prompts.
Note 1: I'm unsure if this is specific to Windows 11 Enterprise, but that is the only OS where I can reproduce this consistently. Note 2: The build script below is using the latest version of ONNXRuntime (1.19.2) but I can reproduce this as far back as 1.16.3, so the issue is not new.
Urgency
This is blocking me from completing an automated build system necessary for CI scripts.
Target platform
Windows 11 Enterprise
Build script
Error / output
Relevant output:
Full output is available here
Visual Studio Version
Visual Studio Enterprise 2022 17.11.4
GCC / Compiler Version
No response