Issues in compiling with Visual Studio 2013
Some projects don't compile under Visual Studio 2013 without changes.
- File.cpp isn't included in project HTKMLFReader. It is easy to fix. Just add the missing file to the project.
- Initialization of array
The errors happen at several places, e.g., in file TensorView.cpp.
void TensorView
::DoUnaryOpOf(ElemType beta, const TensorView& a, ElemType alpha, ElementWiseOperator op) { .... PrepareTensorOperands<ElemType, 2>(array<TensorShape, 2>{a.GetShape(), GetShape()}, offsets, regularOpDims, regularStrides, reducingOpDims, reducingStrides); ... }
I got the following error.
1>TensorView.cpp(291): error C2440: '
My work-around solution is to add an additional pair of '{' and '}' for the array as PrepareTensorOperands<ElemType, 2>(array<TensorShape, 2>{ { a.GetShape(), GetShape()} } , offsets, regularOpDims, regularStrides, reducingOpDims, reducingStrides);
Anyone knows what is the root cause of this compiling error?
Please use VS Update 5. That is the version we use, and it is know that some older versions of 2013 do not yet have the array constructor that is causing the error.
Sent from Outlookhttp://aka.ms/Ox5hz3
On Sat, Jan 30, 2016 at 9:50 AM -0800, "yefeng-zheng" <[email protected]mailto:[email protected]> wrote:
Some projects don't compile under Visual Studio 2013 without changes
1 Filecpp isn't included in project HTKMLFReader It is easy to fix Just add the missing file to the project
2 Initialization of array The errors happen at several places, eg, in file TensorViewcpp void TensorView::DoUnaryOpOf(ElemType beta, const TensorView& a, ElemType alpha, ElementWiseOperator op) {
PrepareTensorOperands<ElemType, 2>(array<TensorShape, 2>{aGetShape(), GetShape()}, offsets, regularOpDims, regularStrides, reducingOpDims, reducingStrides);
}
I got the following error
1>TensorViewcpp(291): error C2440: '' : cannot convert from 'initializer-list' to 'std::arrayMicrosoft::MSR::CNTK::TensorShape,0x04' 1> Constructor for class 'std::arrayMicrosoft::MSR::CNTK::TensorShape,0x04' is declared 'explicit' 1> TensorViewcpp(280) : while compiling class template member function 'void Microsoft::MSR::CNTK::TensorView::DoTernaryOpOf(ElemType,const Microsoft::MSR::CNTK::TensorView &,const Microsoft::MSR::CNTK::TensorView &,const Microsoft::MSR::CNTK::TensorView &,ElemType,Microsoft::MSR::CNTK::ElementWiseOperator)' 1> with 1> [ 1> ElemType=float 1> ] 1> c:\home\library\cntk\source\math\TensorViewh(117) : see reference to function template instantiation 'void Microsoft::MSR::CNTK::TensorView::DoTernaryOpOf(ElemType,const Microsoft::MSR::CNTK::TensorView &,const Microsoft::MSR::CNTK::TensorView &,const Microsoft::MSR::CNTK::TensorView &,ElemType,Microsoft::MSR::CNTK::ElementWiseOperator)' being compiled 1> with 1> [ 1> ElemType=float 1> ] 1> TensorViewcpp(373) : see reference to class template instantiation 'Microsoft::MSR::CNTK::TensorView' being compiled
My work-around solution is to add an additional pair of '{' and '}' for the array as PrepareTensorOperands(array{ { aGetShape(), GetShape()} } , offsets, regularOpDims, regularStrides, reducingOpDims, reducingStrides);
Anyone knows what is the root cause of this compiling error?
Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/CNTK/issues/64.
Yes, the compiling errors are gone after installing Update 5. Thank you very much!