Xstddef(372): error C 2338: The C++ Standard doesn't provide a hash for this type

Hi, I’m trying to compile Pytorch on Windows 10, since the precompiled versions on the website won’t support cuda computability 3.0 any more, but I ran into the following error during compilation:

I’d appreciate any help regarding this issue!

“D:\Portable\pytorch\build\INSTALL.vcxproj” (default target) (1) ->
“D:\Portable\pytorch\build\ALL_BUILD.vcxproj” (default target) (3) ->
“D:\Portable\pytorch\build\c10\test\c10_TypeTraits_test.vcxproj” (default target) (51) ->
(ClCompile target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\xstddef(372): error C
2338: The C++ Standard doesn’t provide a hash for this type. [D:\Portable\pytorch\build\c10\test\c10_TypeTraits_test.vc
xproj]
D:\Portable\pytorch\c10\test\util\TypeTraits_test.cpp(36): error C2338: [D:\Portable\pytorch\build\c10\test\c10_Type
Traits_test.vcxproj]

“D:\Portable\pytorch\build\INSTALL.vcxproj” (default target) (1) ->
“D:\Portable\pytorch\build\ALL_BUILD.vcxproj” (default target) (3) ->
“D:\Portable\pytorch\build\caffe2\torch\torch_python.vcxproj” (default target) (703) ->
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\xstddef(372): error C
2338: The C++ Standard doesn’t provide a hash for this type. (compiling source file D:\Portable\pytorch\torch\csrc\jit
python_arg_flatten.cpp) [D:\Portable\pytorch\build\caffe2\torch\torch_python.vcxproj]
D:\Portable\pytorch\torch/csrc/utils/hash.h(78): error C2668: ‘torch::_hash_detail::dispatch_hash’: ambiguous call to
overloaded function (compiling source file D:\Portable\pytorch\torch\csrc\jit\python_arg_flatten.cpp) [D:\Portable\pyt
orch\build\caffe2\torch\torch_python.vcxproj]

1124 Warning(s)
4 Error(s)

Are you using a script to build from source on Windows?
Have you had a look at @peterjc123’s scripts?
You’ll also find some compiling examples there.

Please update your VS to 15.3.

I get this error with “Visual Studio 2017 Developer Command Prompt v15.9.11”

C:\Users\tobai\AppData\Local\conda\conda\envs\IRIS30\lib\site-packages\torch\lib\include\torch\csrc\api\include\torch/torch.h(7): fatal error C1021: invalid preprocessor command 'warning’error: command ‘C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe’ failed with exit status 2