CNTK failed due to "error C2039: 'runtime_error': is not a member of 'std'" under /permissive- + MSVC
Environment: VS 2017 + Windows Server 2016
Description:
CNTK failed due to "error C2039: 'runtime_error': is not a member of 'std'" under /permissive- mode when built on MSVC. You use std::runtime_error, but don’t have <stdexcept> included until later. Could you please help take a look at this? Thanks in advance!
Repro steps:
- git clone https://github.com/Microsoft/cntk D:\CNTK\src
- open a clean x64 prompt and browse to D:\CNTK\src
- set CL=/openmp- /wd4643 /wd4459 /permissive-
- MSBuild /m /p:Configuration=Release_CpuOnly;Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17134.0 .\src\CNTK.sln /t:Rebuild
Actual result:
CNTKEval.cpp
D:\CNTK\src\Source\Common\Include\Eval.h(288): error C2039: 'runtime_error': is not a member of 'std'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\memory(21): note: see declaration of 'std'
D:\CNTK\src\Source\Common\Include\Eval.h(288): note: This diagnostic occurred in the compiler generated function 'std::vector<Microsoft::MSR::CNTK::ValueBuffer<ElemType,Microsoft::MSR::CNTK::Vector>,std::allocator<_Ty>> Microsoft::MSR::CNTK::VariableSchema::CreateBuffers(const std::vector<size_t,std::allocator
New same error found in file "D:\CNTK\src\Source\CNTKv2LibraryDll\API\CNTKLibraryInternals.h".
D:\CNTK\src\Source\CNTKv2LibraryDll\API\CNTKLibraryInternals.h(121): error C2039: 'runtime_error': is not a member of 'std' C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\unordered_map(24): note: see declaration of 'std' D:\CNTK\src\Source\CNTKv2LibraryDll\API\CNTKLibraryInternals.h(126): error C2039: 'logic_error': is not a member of 'std' C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\unordered_map(24): note: see declaration of 'std' D:\CNTK\src\Source\CNTKv2LibraryDll\API\CNTKLibraryInternals.h(131): error C2039: 'invalid_argument': is not a member of 'std' C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\unordered_map(24): note: see declaration of 'std'
Maybe you can take a look at this and see is it helps?