CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

CNTK failed due to "error C2039: 'runtime_error': is not a member of 'std'" under /permissive- + MSVC

Open QuellaZhang opened this issue 6 years ago • 2 comments

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:

  1. git clone https://github.com/Microsoft/cntk D:\CNTK\src
  2. open a clean x64 prompt and browse to D:\CNTK\src
  3. set CL=/openmp- /wd4643 /wd4459 /permissive-
  4. 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> &)' with [ _Ty=Microsoft::MSR::CNTK::ValueBuffer<ElemType,Microsoft::MSR::CNTK::Vector> ]

QuellaZhang avatar Aug 02 '19 07:08 QuellaZhang

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'

QuellaZhang avatar Dec 24 '19 09:12 QuellaZhang

Maybe you can take a look at this and see is it helps?

delzac avatar Dec 25 '19 04:12 delzac