简体   繁体   English

如何打开英特尔C ++编译器12.1.2的C ++ 0x

[英]How to turn on C++0x of Intel C++ Compiler 12.1.2

I installed the latest version of Intel C++ Compiler v12.1.2 on Arch Linux 3.2.1. 我在Arch Linux 3.2.1上安装了最新版本的英特尔C ++编译器v12.1.2。 When I used icpc to compile my C++ file 当我用icpc编译我的C ++文件时

icpc -O3 -DNDEBUG -std=gnu++0x -o obj/main.o src/main.cpp -c

or 要么

icpc -O3 -DNDEBUG -std=c++0x -o obj/main.o src/main.cpp -c

A warning popped out 突然出现警告

Warning #2928: the __GXX_EXPERIMENTAL_CXX0X__ macro is disabled when using GNU version 4.6 with the c++0x option

My main.cpp contains many C++0x features such as rvalue references, auto, etc. But the Intel compiler did not work in C++0x mode. 我的main.cpp包含许多C ++ 0x功能,例如rvalue references,auto等。但是Intel编译器在C ++ 0x模式下不起作用。 How to turn on its C++0x features? 如何打开其C ++ 0x功能?

I had to fight my way through this, but a quick solution seems to be: 我不得不一直在努力,但快速解决方案似乎是:

  1. Install libstdc++4.5 (or earlier) 安装libstdc ++ 4.5(或更早版本)
  2. compile with icpc -gcc-name=gcc-4.5 -std=c++0x icpc -gcc-name=gcc-4.5 -std=c++0x

The problem is that Intel compilers do not support all the C++0x features that GNU compilers do starting from version 4.6. 问题是英特尔编译器不支持GNU编译器从版本4.6开始执行的所有C ++ 0x功能。 This causes incompatibilities with GNU libstdc++ headers since at present all the C++0x features are protected by a unique macro __GXX_EXPERIMENTAL_CXX0X__ and cannot be enabled or disabled singularly. 这导致与GNU libstdc ++标头不兼容,因为目前所有C ++ 0x功能都受到唯一宏__GXX_EXPERIMENTAL_CXX0X__保护,并且无法单独启用或禁用。

Check here . 点击这里 It seems that C++0x is not fully supported 似乎不完全支持C ++ 0x

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM