How should I disable C++0x and/or C++11 on the command line with Intel's Windows compiler?

StackOverflow https://stackoverflow.com/questions/20287562

  •  06-08-2022
  •  | 
  •  

Pregunta

The build system on my cross-platform project has a command line for Intel's Windows C++ that may or may not have /Qstd=c++0x as a result of detecting the compiler feature set. For most of the code base, this works well, however for a small number of CUDA files, I need to disable the more recent dialects of C++ to suit the constraints of the nvcc wrapper compiler.

How should I phrase something like /Qstd=c++98 or /Qnostd=c++0x at the end of the command line so that it overrides any earlier specifications of C++ dialect?

Edit: Having been educated that these flags are actually for the Intel compiler, I have found that appending /Qstd=c++98 is probably the right approach.

¿Fue útil?

Solución

You can't for MSVC. Each MSVC version expects its own interpretation of something between two or three standards, and you're stuck with it.

The options you quote are for the Intel Compiler (see here). If possible, I'd suggest using the Intel Compiler then.

I do fail to see how disabling the recent dialects in the C++ compiler will please the nvcc wrapper compiler... Just don't write C++11 code, and you'll be fine right?

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top