Compiling jaxlib on Windows 11 - build

I'm trying to compile jaxlib on Windows 11. My CUDA version is 11.7, and my cuDNN version is 8.4. Running in an Ananaconda terminal, I get the following error:
ERROR: C:/users/james/_bazel_james/v4n576ya/external/org_tensorflow/tensorflow/compiler/xla/pjrt/distributed/BUILD:36:11: Compiling tensorflow/compiler/xla/pjrt/distributed/service.cc failed: (Exit 2): python.exe failed: error executing command
cd /d C:/users/james/_bazel_james/v4n576ya/execroot/__main__
SET CUDA_TOOLKIT_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7
SET CUDNN_INSTALL_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7
SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt
SET LIB=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64
SET PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\\Extensions\Microsoft\IntelliCode\CLI;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\devinit;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\;;C:\WINDOWS\system32;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe
SET PWD=/proc/self/cwd
SET RUNFILES_MANIFEST_ONLY=1
SET TEMP=C:\Users\james\AppData\Local\Temp
SET TF_CUDA_COMPUTE_CAPABILITIES=sm_35,sm_52,sm_60,sm_70,compute_80
SET TF_CUDA_PATHS=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7
SET TF_CUDA_VERSION=11.7
SET TF_CUDNN_VERSION=8.4
SET TMP=C:\Users\james\AppData\Local\Temp
C:\Users\james\anaconda3\python.exe -B external/local_config_cuda/crosstool/windows/msvc_wrapper_for_nvcc.py /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0600 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS /bigobj /Zm500 /J /Gy /GF /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /Iexternal/org_tensorflow /Ibazel-out/x64_windows-opt/bin/external/org_tensorflow /Iexternal/com_google_absl /Ibazel-out/x64_windows-opt/bin/external/com_google_absl /Iexternal/com_github_grpc_grpc /Ibazel-out/x64_windows-opt/bin/external/com_github_grpc_grpc /Iexternal/zlib /Ibazel-out/x64_windows-opt/bin/external/zlib /Iexternal/upb /Ibazel-out/x64_windows-opt/bin/external/upb /Iexternal/boringssl /Ibazel-out/x64_windows-opt/bin/external/boringssl /Iexternal/com_google_protobuf /Ibazel-out/x64_windows-opt/bin/external/com_google_protobuf /Iexternal/nsync /Ibazel-out/x64_windows-opt/bin/external/nsync /Iexternal/eigen_archive /Ibazel-out/x64_windows-opt/bin/external/eigen_archive /Iexternal/gif /Ibazel-out/x64_windows-opt/bin/external/gif /Iexternal/libjpeg_turbo /Ibazel-out/x64_windows-opt/bin/external/libjpeg_turbo /Iexternal/com_googlesource_code_re2 /Ibazel-out/x64_windows-opt/bin/external/com_googlesource_code_re2 /Iexternal/farmhash_archive /Ibazel-out/x64_windows-opt/bin/external/farmhash_archive /Iexternal/fft2d /Ibazel-out/x64_windows-opt/bin/external/fft2d /Iexternal/highwayhash /Ibazel-out/x64_windows-opt/bin/external/highwayhash /Iexternal/double_conversion /Ibazel-out/x64_windows-opt/bin/external/double_conversion /Iexternal/snappy /Ibazel-out/x64_windows-opt/bin/external/snappy /Iexternal/local_config_cuda /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda /Iexternal/local_config_rocm /Ibazel-out/x64_windows-opt/bin/external/local_config_rocm /Iexternal/local_config_tensorrt /Ibazel-out/x64_windows-opt/bin/external/local_config_tensorrt /Iexternal/cudnn_frontend_archive /Ibazel-out/x64_windows-opt/bin/external/cudnn_frontend_archive /Iexternal/llvm-project /Ibazel-out/x64_windows-opt/bin/external/llvm-project /Iexternal/llvm_terminfo /Ibazel-out/x64_windows-opt/bin/external/llvm_terminfo /Iexternal/llvm_zlib /Ibazel-out/x64_windows-opt/bin/external/llvm_zlib /Iexternal/curl /Ibazel-out/x64_windows-opt/bin/external/curl /Iexternal/jsoncpp_git /Ibazel-out/x64_windows-opt/bin/external/jsoncpp_git /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda/cuda/_virtual_includes/cuda_headers_virtual /Ibazel-out/x64_windows-opt/bin/external/local_config_tensorrt/_virtual_includes/tensorrt_headers /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda/cuda/_virtual_includes/cudnn_header /Ibazel-out/x64_windows-opt/bin/external/cudnn_frontend_archive/_virtual_includes/cudnn_frontend /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/BuiltinAttributeInterfacesIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/BuiltinAttributesIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/BuiltinDialectIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/BuiltinLocationAttributesIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/BuiltinOpsIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/BuiltinTypeInterfacesIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/BuiltinTypesIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/CallOpInterfacesIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/CastOpInterfacesIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/FunctionInterfacesIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/InferTypeOpInterfaceIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/OpAsmInterfaceIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/RegionKindInterfaceIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/SideEffectInterfacesIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/SubElementInterfacesIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/SymbolInterfacesIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/TensorEncodingIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/ControlFlowInterfacesIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/LoopLikeInterfaceIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/InferIntRangeInterfaceIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/ViewLikeInterfaceIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/PDLOpsIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/PDLTypesIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/PDLInterpOpsIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/ConversionPassIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/TransformsPassIncGen /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/ParserTokenKinds /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/_virtual_includes/DerivedAttributeOpInterfaceIncGen /Iexternal/com_github_grpc_grpc/include /Ibazel-out/x64_windows-opt/bin/external/com_github_grpc_grpc/include /Iexternal/com_github_grpc_grpc/src/core/ext/upb-generated /Ibazel-out/x64_windows-opt/bin/external/com_github_grpc_grpc/src/core/ext/upb-generated /Iexternal/zlib /Ibazel-out/x64_windows-opt/bin/external/zlib /Iexternal/com_github_grpc_grpc/third_party/address_sorting/include /Ibazel-out/x64_windows-opt/bin/external/com_github_grpc_grpc/third_party/address_sorting/include /Iexternal/boringssl/src/include /Ibazel-out/x64_windows-opt/bin/external/boringssl/src/include /Iexternal/com_google_protobuf/src /Ibazel-out/x64_windows-opt/bin/external/com_google_protobuf/src /Iexternal/nsync/public /Ibazel-out/x64_windows-opt/bin/external/nsync/public /Iexternal/org_tensorflow/third_party/eigen3/mkl_include /Ibazel-out/x64_windows-opt/bin/external/org_tensorflow/third_party/eigen3/mkl_include /Iexternal/eigen_archive /Ibazel-out/x64_windows-opt/bin/external/eigen_archive /Iexternal/gif /Ibazel-out/x64_windows-opt/bin/external/gif /Iexternal/gif/windows /Ibazel-out/x64_windows-opt/bin/external/gif/windows /Iexternal/farmhash_archive/src /Ibazel-out/x64_windows-opt/bin/external/farmhash_archive/src /Iexternal/local_config_cuda/cuda /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda/cuda /Iexternal/local_config_cuda/cuda/cuda/include /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda/cuda/cuda/include /Iexternal/local_config_rocm/rocm /Ibazel-out/x64_windows-opt/bin/external/local_config_rocm/rocm /Iexternal/local_config_rocm/rocm/rocm/include /Ibazel-out/x64_windows-opt/bin/external/local_config_rocm/rocm/rocm/include /Iexternal/local_config_rocm/rocm/rocm/include/rocrand /Ibazel-out/x64_windows-opt/bin/external/local_config_rocm/rocm/rocm/include/rocrand /Iexternal/local_config_rocm/rocm/rocm/include/roctracer /Ibazel-out/x64_windows-opt/bin/external/local_config_rocm/rocm/rocm/include/roctracer /Iexternal/llvm-project/llvm/include /Ibazel-out/x64_windows-opt/bin/external/llvm-project/llvm/include /Iexternal/llvm-project/mlir/include /Ibazel-out/x64_windows-opt/bin/external/llvm-project/mlir/include /Iexternal/curl/include /Ibazel-out/x64_windows-opt/bin/external/curl/include /Iexternal/jsoncpp_git/include /Ibazel-out/x64_windows-opt/bin/external/jsoncpp_git/include /DGRPC_ARES=0 /DEIGEN_MPL2_ONLY /DEIGEN_MAX_ALIGN_BYTES=64 /DTF_USE_SNAPPY /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_NONSTDC_NO_WARNINGS /D_SCL_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_WARNINGS /DUNICODE /D_UNICODE /DLTDL_SHLIB_EXT=".dll" /DLLVM_PLUGIN_EXT=".dll" /DLLVM_NATIVE_ARCH="X86" /DLLVM_NATIVE_ASMPARSER=LLVMInitializeX86AsmParser /DLLVM_NATIVE_ASMPRINTER=LLVMInitializeX86AsmPrinter /DLLVM_NATIVE_DISASSEMBLER=LLVMInitializeX86Disassembler /DLLVM_NATIVE_TARGET=LLVMInitializeX86Target /DLLVM_NATIVE_TARGETINFO=LLVMInitializeX86TargetInfo /DLLVM_NATIVE_TARGETMC=LLVMInitializeX86TargetMC /DLLVM_NATIVE_TARGETMCA=LLVMInitializeX86TargetMCA /DLLVM_HOST_TRIPLE="x86_64-pc-win32" /DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-pc-win32" /D__STDC_LIMIT_MACROS /D__STDC_CONSTANT_MACROS /D__STDC_FORMAT_MACROS /DBLAKE3_USE_NEON=0 /DBLAKE3_NO_AVX2 /DBLAKE3_NO_AVX512 /DBLAKE3_NO_SSE2 /DBLAKE3_NO_SSE41 /DCURL_STATICLIB /showIncludes /MD /O2 /DNDEBUG /D_USE_MATH_DEFINES -DWIN32_LEAN_AND_MEAN -DNOGDI /Zc:preprocessor -DMLIR_PYTHON_PACKAGE_PREFIX=jaxlib.mlir. /std:c++17 /Fobazel-out/x64_windows-opt/bin/external/org_tensorflow/tensorflow/compiler/xla/pjrt/distributed/_objs/service/service.obj /c external/org_tensorflow/tensorflow/compiler/xla/pjrt/distributed/service.cc
# Configuration: 811287892cd1fa60d87f2595f4da3ac801092bc8e23503f8ba175e355cf85d95
# Execution platform: #local_execution_config_platform//:platform
Target //build:build_wheel failed to build
INFO: Elapsed time: 12.778s, Critical Path: 10.89s
INFO: 21 processes: 18 internal, 3 local.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
b"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\um\\winbase.h(9531): warning C5105: macro expansion producing 'defined' has undefined behavior\r\nexternal/org_tensorflow/tensorflow/compiler/xla/pjrt/distributed/service.cc(56): error C2398: Element '1': conversion from 'size_t' to 'const Key &' requires a narrowing conversion\r\n with\r\n [\r\n Key=google::protobuf::int32\r\n ]\r\n"
Traceback (most recent call last):
File "C:\WINDOWS\system32\jax\build\build.py", line 528, in <module>
main()
File "C:\WINDOWS\system32\jax\build\build.py", line 523, in main
shell(command)
File "C:\WINDOWS\system32\jax\build\build.py", line 53, in shell
output = subprocess.check_output(cmd)
File "C:\Users\james\anaconda3\lib\subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Users\james\anaconda3\lib\subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['.\\bazel-5.1.1-windows-x86_64.exe', 'run', '--verbose_failures=true', '--config=mkl_open_source_only', '--config=cuda', ':build_wheel', '--', '--output_path=C:\\WINDOWS\\system32\\jax\\dist', '--cpu=AMD64']' returned non-zero exit status 1.
Any help on what's causing this? Thanks!

Related

error MSB6006: "link.exe" exited with code 1 When run SDV ( Static Driver Verifier) , Visual studio 2019 , SDK 10 build 19041, windows 10 build 19041

We create new KMDF USB project ,
Open visual studio 2019 v 16.11, go to File -> new -> project -> chose Kernel Mode Driver, USB (KMDF).
without any modification, this project have no error, no warning when building.
when we run SDV ( Static Driver Verifier) for this project the smvbuild.log show this error.
C:\Program Files (x86)\Windows Kits\10\TOOLS\SDV\smv\bin\link.exe /ERRORREPORT:QUEUE /OUT:"C:\Users\tungpvt\source\repos\USB Driver2Release\USBDriver2.sys" /VERSION:"10.0" /INCREMENTAL:NO /NOLOGO /WX /SECTION:"INIT,d" "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\km\x86\BufferOverflowFastFailK.lib" "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\km\x86\ntoskrnl.lib" "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\km\x86\hal.lib" "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\km\x86\wmilib.lib" "C:\Program Files (x86)\Windows Kits\10\lib\wdf\kmdf\x86\1.15\WdfLdr.lib" "C:\Program Files (x86)\Windows Kits\10\lib\wdf\kmdf\x86\1.15\WdfDriverEntry.lib" usbdex.lib ntstrsafe.lib "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\km\x86\wpprecorder.lib" /NODEFAULTLIB /MANIFEST:NO /DEBUG /PDB:"C:\Users\tungpvt\source\repos\USB Driver2Release\USBDriver2.pdb" /SUBSYSTEM:NATIVE,"10.00" /Driver /OPT:REF /OPT:ICF /ENTRY:"FxDriverEntry#8" /RELEASE /IMPLIB:"C:\Users\tungpvt\source\repos\USB Driver2Release\USBDriver2.lib" /MERGE:"_TEXT=.text;_PAGE=PAGE" /MACHINE:X86 /PROFILE /SAFESEH /guard:cf /kernel /IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221 /osversion:10.0 /pdbcompress /debugtype:pdata Release\Device.obj
Release\Driver.obj
Release\Queue.obj
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(1074,5): error MSB6006: "link.exe" exited with code 1. [C:\Users\tungpvt\source\repos\USB Driver2\USB Driver2\USB Driver2.vcxproj]
Done executing task "Link" -- FAILED.
Done building target "Link" in project "USB Driver2.vcxproj" -- FAILED.
Done Building Project "C:\Users\tungpvt\source\repos\USB Driver2\USB Driver2\USB Driver2.vcxproj" (rebuild target(s)) -- FAILED.
In additional, when running the link.exe on command line, Visual studio -> Tools -> Command Line -> Developer Command Prompt with same parameter like above it shows:
Failed to load Intercept.XML:
Could not find file 'c:\program files (x86)\windows kits\10\tools\sdv\smv\bin\%BE%-Intercept.xml'.
we've added the BE and smv variables to Windows system environment
variable name: BE , variable value: MSBuild
variable name: smv , variable value: C:\Program Files (x86)\Windows Kits\10\Tools\sdv\smv
In Linker session in Project properties, we modified Project properties -> Linker -> Input -> Additional Dependency to
%(AdditionalDependencies);$(DDK_LIB_PATH)usbdex.lib;$(DDK_LIB_PATH)ntstrsafe.lib
Then we can pass the command line
C:\Program Files (x86)\Windows Kits\10\TOOLS\SDV\smv\bin\link.exe /ERRORREPORT:QUEUE /OUT:"C:\Users\tungpvt\source\repos\USB Driver2Release\USBDriver2.sys" /VERSION:"10.0" /INCREMENTAL:NO /NOLOGO /WX /SECTION:"INIT,d" "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\km\x86\BufferOverflowFastFailK.lib" "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\km\x86\ntoskrnl.lib" "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\km\x86\hal.lib" "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\km\x86\wmilib.lib" "C:\Program Files (x86)\Windows Kits\10\lib\wdf\kmdf\x86\1.15\WdfLdr.lib" "C:\Program Files (x86)\Windows Kits\10\lib\wdf\kmdf\x86\1.15\WdfDriverEntry.lib" "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\km\x86\usbdex.lib" "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\km\x86\ntstrsafe.lib" "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\km\x86\wpprecorder.lib" /NODEFAULTLIB /MANIFEST:NO /DEBUG /PDB:"C:\Users\tungpvt\source\repos\USB Driver2Release\USBDriver2.pdb" /SUBSYSTEM:NATIVE,"10.00" /Driver /OPT:REF /OPT:ICF /ENTRY:"FxDriverEntry#8" /RELEASE /IMPLIB:"C:\Users\tungpvt\source\repos\USB Driver2Release\USBDriver2.lib" /MERGE:"_TEXT=.text;_PAGE=PAGE" /MACHINE:X86 /PROFILE /SAFESEH /guard:cf /kernel /IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221 /osversion:10.0 /pdbcompress /debugtype:pdata Release\Device.obj
Release\Driver.obj
Release\Queue.obj
But still run the SDV error.
please help me to fix this.
thanks.
===========================================================================
After I update to latest SDK, WDK to version 10.1.22000, and update visual studio 2019 and the error of the template driver gone away, but I facing other problem in my project in
sdv/smvcl.log
c1 : fatal error C1252: Circular or missing dependency between plugins: 'PREfast Drivers Plugin' requires GUID '{EB170136-3433-4C16-AE1D-8998BA5CAB16}'.
can anyone help me?
Hi I had this problem (linker error on static driver verifier build) with WDK 10.0.22000 (with visual studio 2019) and here's the solution I've found: it links when the macro NT_PROCESSOR_GROUPS is defined at compile time (have to rebuild all), so adding this macro to the preprocessor definitions does the trick (at least for my setup).
Just in case you are running across static driver verifier failures now or in the future, here is a useful hint:
Run SDV target with /debug enabled: so
msbuild /t:sdv /p:Inputs="/check:* /debug" path\to\myproject.vcxproj /p:Configuration=Release /p:Platform=x64 /maxCpuCount=8
will create debug logs. The output of the linker is found in the sdv subdirectory
and is named smvlink1.log . There are other useful logfiles in that directory (took me a long time to find them but the output directed me to the solution I proposed above).
You're not alone in encountering problems with SDV in Visual Studio 2019. I ran into this with a mature driver after updating the tools and rebuilding. Fortunately, as is often the case, the good guys at OSR already ran headfirst into this wall themselves, and found a solution:
It seems that if you try to run SDV on a driver project that has “Enable Code Analysis on Build” set to YES, SDV will always fail in the way you see illustrated above. So, the fix is to disable Code Analysis on Build and be sure to save the project to disk. Then run SDV.
The driver I was working on did indeed have "Enable Code Analysis on Build" turned on. Turning it off allowed SDV to build it successfully.

Clang doesn't know PTRDIFF_MAX?

I'm upgrading our build machine (from Windows Server 2008 to Windows 10) and have a build that ran fine on the old machine (using Visual Studio). I had some problems getting it to run with VS Build Tools (I'm trying to avoid needing a VS license) on the new machine, so I'm porting it to use Clang.
The build uses Flatbuffers, which I have upgraded from 1.4.0 to 1.12.0. I'm getting the following error during the build:
[2/70] Building CXX object CMakeFiles\polyphemus.dir\hardwareconfig.cpp.obj
FAILED: CMakeFiles/polyphemus.dir/hardwareconfig.cpp.obj
C:\PROGRA~2\MICROS~1\2019\BUILDT~1\VC\Tools\Llvm\x64\bin\clang-cl.exe /nologo -TP -I"C:\Program Files (x86)\nanomsg\include\nanomsg" -I. -I"C:\Program Files (x86)\FlatBuffers\include" -IE:\JenkinsMIDEBLD\workspace\btaylor-new_build_node_CYC-268_2\polyphemus\include /DWIN32 /D_WINDOWS /GR /EHsc /Zi /Ob0 /Od /RTC1 -MDd /showIncludes /FoCMakeFiles\polyphemus.dir\hardwareconfig.cpp.obj /FdCMakeFiles\polyphemus.dir\polyphemus.pdb -c E:\JenkinsMIDEBLD\workspace\btaylor-new_build_node_CYC-268_2\polyphemus\hardwareconfig.cpp
In file included from E:\JenkinsMIDEBLD\workspace\btaylor-new_build_node_CYC-268_2\polyphemus\hardwareconfig.cpp:3:
In file included from .\hardwareconfig_generated.h:7:
In file included from C:\Program Files (x86)\FlatBuffers\include\flatbuffers/flatbuffers.h:20:
In file included from C:\Program Files (x86)\FlatBuffers\include\flatbuffers/base.h:45:
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\algorithm(37,63): error: use of undeclared identifier 'PTRDIFF_MAX'
return static_cast<ptrdiff_t>(_Min_value(static_cast<_CT>(PTRDIFF_MAX), static_cast<_CT>(_Value)));
Not having PTRDIFF_MAX defined is really rather odd, and suggests that Flatbuffers should have done #include <cstdint> in its files, but hasn't. This seems like something that would cause tests to fail, so I can't believe that's an undiagnosed bug. Sure enough, if I add #include <cstdint> to my files, they start building. This really doesn't seem like the correct solution though - I can't believe that Flatbuffers has an undocumented dependency that you have to do that import yourself, which suggests I'm doing something wrong. Does anyone know what, please?
EDIT: Explicitly turning on C++17 in cmake (and from there in clang) results in the same error in a different place that doesn't involve flatbuffers:
In file included from E:\JenkinsMIDEBLD\workspace\btaylor-new_build_node_CYC-268_2\polyphemus\complexseries.cpp:2:
In file included from E:\JenkinsMIDEBLD\workspace\btaylor-new_build_node_CYC-268_2\polyphemus\include\polyphemus/complexseries.h:4:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\complex:12:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\sstream:11:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\istream:11:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\ostream:11:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\ios:11:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\xlocnum:16:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\streambuf:11:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\xiosbase:12:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\system_error:14:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\stdexcept:12:
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\xstring(1258,47): error: use of undeclared identifier 'PTRDIFF_MAX'
return _Min_value(static_cast<size_t>(PTRDIFF_MAX), static_cast<size_t>(-1) / sizeof(_Elem));
That's in a file where I'd done my own #include of , so I guess that's a red herring (and also not a fix :-/ ).
Turned out that I had in my include path a version of stdint.h that specifies it was for use "only with Microsoft Visual C++ compilers!". Unsurprisingly, it turns out it doesn't work with Clang. You'd expect it to either fail catastrophically or else just work anyway (it does define PTRDIFF_MAX), but I guess it just causes Clang to be very very confused.
Anyway, if I remove it from my include path, things start working.

Generating windows IoT 10 Image: ImageApp!ConfigureServicingStackLogging: Failed initializing WdsCore.dll

I'm finding several with the windows IoT 10 image generation for IMX6Q board when building .sln project (using visual studio 2017), specifically from the FFU generator.
The log file contains these following statements:
Run Feature Merger
C:\Users\ASUS\Desktop\imx6\windows\project-kayla-develop\build\tools\sign.cmd
C:\Program Files (x86)\Windows Kits\10\tools\bin\i386\sign.cmd
Begin Image generation
building image
imggen.cmd "C:\Users\ASUS\Desktop\imx6\windows\project-kayla-develop\build\\solution\iMXPlatform\Build\FFU\HummingBoard\HummingBoardTestOEMInput.xml.Release.ffu" "C:\Users\ASUS\Desktop\imx6\windows\project-kayla-develop\build\\board\HummingBoard\HummingBoardTestOEMInput.xml" "C:\Program Files (x86)\Windows Kits\10\MSPackages"
Microsoft (C) imageapp 10.0.10011.16384
ImageApp!ConfigureServicingStackLogging: Failed initializing WdsCore.dll.
EXEC : ThreadId8028 error : Please run imageapp.exe in an elevated console.
Exception non gérée : System.IO.DirectoryNotFoundException: Le chemin d'accès spécifié est introuvable.
à Microsoft.WindowsPhone.ImageUpdate.Tools.Common.LongPathFile.GetFileHandle(String normalizedPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
à Microsoft.WindowsPhone.ImageUpdate.Tools.Common.LongPathFile.Open(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
à Microsoft.WindowsPhone.ImageUpdate.Tools.Common.LongPathFile.AppendAllText(String path, String contents, Encoding encoding)
à Microsoft.WindowsPhone.ImageUpdate.ImageApp.AppendToLog(String prepend, LoggingFunc LoggingFunc, String format, Object[] list)
à Microsoft.WindowsPhone.ImageUpdate.ImageApp.LogErrorToFileAndConsole(String format, Object[] list)
à Microsoft.WindowsPhone.ImageUpdate.Tools.Common.IULogger.Log(LoggingLevel level, String format, Object[] list)
à Microsoft.WindowsPhone.ImageUpdate.ImageApp.Main()
"ImageApp "C:\Users\ASUS\Desktop\imx6\windows\project-kayla-develop\build\\solution\iMXPlatform\Build\FFU\HummingBoard\HummingBoardTestOEMInput.xml.Release.ffu" "C:\Users\ASUS\Desktop\imx6\windows\project-kayla-develop\build\\board\HummingBoard\HummingBoardTestOEMInput.xml" "C:\Program Files (x86)\Windows Kits\10\MSPackages" +StrictSettingPolicies" failed with error -532462766
!!!!! If the error was a Feature Manifest XML error, please check
C:\Users\ASUS\Desktop\imx6\windows\project-kayla-develop\build\solution\iMXPlatform\GenerateTestFFU\fmlog.txt !!!!!
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(49,5): error MSB3073: La commande "
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(49,5): error MSB3073: set Configuration=iMX6-Release
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(49,5): error MSB3073: set Platform=ARM
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(49,5): error MSB3073: set PkgOutput=C:\Users\ASUS\Desktop\imx6\windows\project-kayla-develop\build\solution\iMXPlatform\Build\iMX6-Release\ARM\
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(49,5): error MSB3073: set OutDir=C:\Users\ASUS\Desktop\imx6\windows\project-kayla-develop\build\solution\iMXPlatform\Build\iMX6-Release\ARM\GenerateTestFFU\
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(49,5): error MSB3073: call GenerateiMX6FFU.bat
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(49,5): error MSB3073: " s'est arrêtée avec le code 1.`

Clang++ 4.0.0 compilation error in windows

I'm using clang 4.0.0 compiled from source on windows 10 (32-bit OS, x86 processor). I'm trying to compile my cpp code to llvm ir code of the format ll.
Here's a sample code which fails to compile using clang:
#include <windows.h>
#include <tlhelp32.h>
#include <fstream>
#include <mapi.h>
#include <memory>
#include<stdio.h>
/* Function to calculate x raised to the power y */
int power(int x, unsigned int y)
{
if (y == 0)
return 1;
else if (y%2 == 0)
return power(x, y/2)*power(x, y/2);
else
return x*power(x, y/2)*power(x, y/2);
}
/* Program to test function power */
int main()
{
int x = 2;
unsigned int y = 3;
printf("%d", power(x, y));
return 0;
}
This is just a sample code, but it's the same behavior across all c++ code which include the listed header files.
I use the following command to compile it to llvm ir code:
clang++ -S -emit-llvm assiral.cpp -o assiral.ll
On compilation I get the following error:
C:\Sample>clang++ -emit-llvm -S assiral.cpp -o assiral.ll
In file included from assiral.cpp:3:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\fstream:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\includem:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\ostream:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\ios:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xlocnum:7:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\cmath:617:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xtgmath.h:9:
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xtr1common:204:22: error:
use of undeclared identifier 'char16_t'
struct _Is_integral<char16_t>
^
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xtr1common:210:22: error:
use of undeclared identifier 'char32_t'
struct _Is_integral<char32_t>
^
In file included from assiral.cpp:3:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\fstream:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\includem:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\ostream:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\ios:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xlocnum:10:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\streambuf:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xiosbase:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xlocale:8:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\stdexcept:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\exception:7:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\type_traits:6:
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xstddef:257:2: error: 'auto'
return without trailing return type; deduced return types are a C++14 extension
auto _Unfancy(_Ptrty _Ptr)
^
In file included from assiral.cpp:3:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\fstream:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\includem:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\ostream:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\ios:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xlocnum:10:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\streambuf:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xiosbase:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xlocale:8:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\stdexcept:7:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xstring:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xmemory0:8:
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\limits:612:33: error: use of
undeclared identifier 'char16_t'
template<> class numeric_limits<char16_t>
^
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\limits:902:33: error: use of
undeclared identifier 'char32_t'
template<> class numeric_limits<char32_t>
^
In file included from assiral.cpp:3:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\fstream:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\includem:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\ostream:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\ios:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xlocnum:10:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\streambuf:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xiosbase:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xlocale:8:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\stdexcept:7:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xstring:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xmemory0:10:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xutility:8:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\utility:7:
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\iosfwd:254:21: error: use of
undeclared identifier 'char16_t'
struct char_traits<char16_t>
^
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\iosfwd:263:21: error: use of
undeclared identifier 'char32_t'
struct char_traits<char32_t>
^
In file included from assiral.cpp:3:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\fstream:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\includem:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\ostream:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\ios:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xlocnum:10:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\streambuf:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xiosbase:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xlocale:8:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\stdexcept:7:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xstring:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xmemory0:10:
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xutility:698:2: error:
'auto' return without trailing return type; deduced return types are a C++14 extension
auto _Unchecked_n(_Iter _Src, _Diff)
^
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xutility:742:2: error:
'auto' return without trailing return type; deduced return types are a C++14 extension
auto _Unchecked_n_backward(_Iter _Src, _Diff)
^
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xutility:1142:12: error:
deduced return types are a C++14 extension
constexpr decltype(auto) _Operator_arrow(_Iterator&& _Target, false_type)
^
In file included from assiral.cpp:3:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\fstream:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\includem:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\ostream:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\ios:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xlocnum:10:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\streambuf:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xiosbase:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xlocale:8:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\stdexcept:7:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xstring:6:
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xmemory0:356:2: error:
'auto' return without trailing return type; deduced return types are a C++14 extension
auto _Const_cast(_Ptrty _Ptr)
^
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xmemory0:366:2: error:
'auto' return without trailing return type; deduced return types are a C++14 extension
auto _Const_cast(_Ty * _Ptr)
^
In file included from assiral.cpp:3:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\fstream:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\includem:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\ostream:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\ios:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xlocnum:10:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\streambuf:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xiosbase:6:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xlocale:8:
In file included from C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\stdexcept:7:
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xstring:75:2: error:
statement not allowed in constexpr function
for (auto _Match_try = _Haystack + _Start_at; ; ++_Match_try)
^
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xstring:119:3: error:
statement not allowed in constexpr function
for (auto _Match_try = _Haystack + _Min_value(_Start_at, _Hay_size - _Needle_size); ; --_Match_try)
^
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xstring:144:3: error:
statement not allowed in constexpr function
for (auto _Match_try = _Haystack + _Min_value(_Start_at, _Hay_size - 1); ; --_Match_try)
^
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xstring:169:3: error:
statement not allowed in constexpr function
for (auto _Match_try = _Haystack + _Start_at; _Match_try < _End; ++_Match_try)
^
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xstring:188:3: error:
statement not allowed in constexpr function
for (auto _Match_try = _Haystack + _Min_value(_Start_at, _Hay_size - 1); ; --_Match_try)
^
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xstring:213:3: error:
statement not allowed in constexpr function
for (auto _Match_try = _Haystack + _Start_at; _Match_try < _End; ++_Match_try)
^
C:\Program Files\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xstring:233:3: error:
statement not allowed in constexpr function
for (auto _Match_try = _Haystack + _Start_at; _Match_try < _End; ++_Match_try)
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
What I expect after running the command is to have the bytecode file generated (.ll file). I've seen many posts where they introduce a flag : '-fms-compatibility-version=19' along with the command. However the flag added gets flagged as an unknown argument. I'm working with MSVS 2017. Maybe I'm using this flag wrong. But I've been at this impasse for a day now. Any help or suggestion would be greatly appreciated.
This was fixed by adding the correct path to the header files in the environment variable INCLUDE. Most of my errors were resolved once I fixed the paths. This includes the error where compiling a c++ file which references certain headers like windows.h gives a file not found.
Link on how to do the same : List all environment variables from command line?
You can also fix another issue which is :
link fatal error lnk1104 cannot open file 'libcmt.lib'
by setting the LIBPATH environment variable to point to the right location of the libcmt.lib file. I found mine at:
C:\Program Files\Microsoft Visual Studio 14.0\VC\lib
These trivial issues left me spending quite a few days to figure out. Hope this saves someone the same trouble.

Windows - only the first entry of PATH-environment variable can be found

The following problem with my PATH-environment variable I have for some time, and it's become untolerable annoying so I would appreciate help a lot.
The following is the content of my system environment variables, which is also the output of echo %PATH% on cmd-exe.
C:\MinGW\bin; C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin; C:\msys\1.0\bin; C:\Qt\5.3\msvc2013_64\bin; C:\Users\Public\Documents\Embarcadero\Studio\15.0\Bpl;C:\Program Files (x86)\Embarcadero\Studio\15.0\bin64;C:\Users\Public\Documents\Embarcadero\Studio\15.0\Bpl\Win64;C:\Program Files\doxygen\bin;%ANT_HOME%\bin; %JAVA_HOME%\bin; %M2_HOME%\bin; C:\Program Files (x86)\MiKTeX 2.8\miktex\bin; C:\Program Files\PDF Split And Merge Basic\bin; C:\Program Files\Microsoft\Web Platform Installer; C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Windows Live\Shared;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\SlikSvn\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\doxygen\bin
The thing is now, that only the first entry of this can be used, i.e the command "g++" (which is in C:\MinGW\bin ) can be found, but already the command "cl" (which is in C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin) can't be found, and all subsequent commands also not.
What am I doing wrong?