Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Requirements for C++11 Support on Windows

Matt_F_1
Beginner
651 Views

I have Intel C++ 14.0.2 installed on Windows 7 with Visual Studio 2008. I need to use some C++11 features, such as:

[cpp]
#include <memory>
int main(int argc, char** argv){
  std::unique_ptr<int> ptr;
  return 1;
}
[/cpp]

Trying to compile this manually on the Intel Parallel Studio cmd window using: "icl /Qstd=c++11 main.cpp"
results in the error message: 'error: namespace "std" has no member "unique_ptr"'

Is this intended to work? Does Intel Parallel Studio contain its own complete C++ headers, or does it rely on Visual Studio to provide them?
If the latter, what is the purpose of std=c++11? I recall seeing documentation about this topic somewhere in the past, but did not find anything obvious, e.g., in the /Qstd manual entry.

I realize that VS2008 is rather old and hope to upgrade in the near future. However I really have no use for anything but icl/ifort at the moment.

Thank you,
Matt

 

0 Kudos
5 Replies
Marián__VooDooMan__M
New Contributor II
651 Views

Hi,

ICC on Windows rely on MSVC headers and CRT library, on Linux on gcc and glibc library. This is for providing maximum compatibility with native environment. MSVC 2008 is very old, you should be fine with 2012 or even better, MSVC 2013.

0 Kudos
Matt_F_1
Beginner
651 Views

So this means that Intel C++ on Windows only has the C++11 support that Microsoft provides? Then what is the meaning of the manual description for /Qstd:

DEFAULTS /Qstd=OFF. Note that a subset of C++11 features is enabled by default for compatibility with a particular version of Microsoft Visual Studio* C++, so you only need to specify /Qstd=c++0x if you want additional C++11 functionality beyond what Microsoft provides.

How does Intel "add additional C++11 functionality beyond what Microsoft provides" if it relies on the MS headers and library?! I can understand using these headers and libraries by default (for compatibility), but wouldn't Intel need to provide updated headers for their C++11 improvements?

Thank you, 
- Matt

0 Kudos
Marián__VooDooMan__M
New Contributor II
651 Views

Hi Matt

Remember C++0x and 11 is not only about STL headers, but also the syntax has been improved, like r-value references, variadic template arguments, strongly-typed enums, lambda functions and many more.

0 Kudos
Marián__VooDooMan__M
New Contributor II
651 Views

Btw, MSVC 2008 reached end-of-life and many projects dropped support for this archaic compiler. When you are speaking about C++11, you are definitely speaking of MSVC 2013. On Linux, the same situation is there.

0 Kudos
Judith_W_Intel
Employee
651 Views

 

Yes /Qstd=c++11 provides lots of additional c++11 compiler support (i.e. language features), but does not provide any additional c++11 library support.

0 Kudos
Reply