Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Starlin
Beginner
266 Views

Problems with icc 17.0 and Visual Studio 2017

Running Windows 10, VS Community 2017 15.6.0 and Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.6.270 Build 20171215.

The following code does not compile:

#include <string>

int main()
{
	std::string s0("Initial string");
    return 0;
}

with the following two errors:

1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xutility(680): error : an explicit template argument list is not allowed on this declaration
1>  _INLINE_VAR constexpr bool _Is_iterator_v<_Ty, void_t<_Iter_cat_t<_Ty>>> = true;
1>                             ^
1>          detected during:
1>            instantiation of "const bool std::_Is_iterator_v [with _Ty=char *, <unnamed>=void]" at line 520 of "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\string"
1>            instantiation of "std::basic_string<_Elem, std::char_traits<_Elem>, std::allocator<_Elem>> std::_Integral_to_string<_Elem,_Ty>(_Ty) [with _Elem=char, _Ty=int]" at line 554 of "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\string"
1>
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xutility(680): error : an explicit template argument list is not allowed on this declaration
1>  _INLINE_VAR constexpr bool _Is_iterator_v<_Ty, void_t<_Iter_cat_t<_Ty>>> = true;
1>                             ^
1>          detected during:
1>            instantiation of "const bool std::_Is_iterator_v [with _Ty=__wchar_t *, <unnamed>=void]" at line 520 of "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\string"
1>            instantiation of "std::basic_string<_Elem, std::char_traits<_Elem>, std::allocator<_Elem>> std::_Integral_to_string<_Elem,_Ty>(_Ty) [with _Elem=__wchar_t, _Ty=int]" at line 600 of "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\string"

 

Any help is very appreciated. 

0 Kudos
1 Reply
Starlin
Beginner
266 Views

OK, after some digging I *think* I have managed to figure out what is happening - a confirmation on this would be greatly appreciated by someone more knowledgeable, as I am just a student in this.

A side note, both intel compiler 17.0 and 18.0 are affected in a default installation of visual studio 2017 community - the errors are different for 18.0, but still compilation is not possible. 

The main culprit (probably obvious to most of you) is the base platform toolset. Using v140, compilation is possible, however, documentation of the compiler states (here) that it *should* work with the default v141 coming with VS2017.

After much searching, I stumbled upon this blog post where the MS guys list (as of writing of that blog post) several minor versions of the v141 toolset. Unfortunately, changing the minor version of toolset is not possible from within VS2017, but needs direct editing of vsproj files. 

Long story short, as of version 15.6.4, there are three toolsets that could be downloaded for v141 - a standard one, and v14.11 and v14.12.

My testing so far shows that intel compilers versions 17.0 and 18.0 (latest updates) work with v14.11 but not with the default or v14.12. 

I will continue to see how i can leave only v14.11 as a toolset, as my main goal is actually to use the icc as a compiler for matlab's mex files.

Reply