gcc 和 intel 在 redhat 上的 icpc 不识别命名空间 std::literals;
gcc and intel's icpc on redhat do not recognize namespace std::literals;
我在编译以下内容时收到“文字”不是命名空间名称的错误
#include <complex>
using namespace std::literals;
...
它在 Windows 上使用 MSVC 编译良好,甚至在 OS X 上使用 clang 编译,但在使用 gcc 和英特尔的 icpc 的 redhat 7 上失败。
some more detail:
the system
cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
gcc version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Intel compiler version
icpc --version
icpc (ICC) 16.0.3 20160415
Copyright (C) 1985-2016 Intel Corporation. All rights reserved.
compiler call
gcc filename.cpp -std=c++1y
icpc filename.cpp -std=c++14
我错过了什么?
ps:即使像 in this live demo 这样的简单代码也不起作用:(
GCC 4.8.x 附带的 libstdc++ 没有这些文字; they started shipping beginning with GCC 4.9.0.
我在编译以下内容时收到“文字”不是命名空间名称的错误
#include <complex>
using namespace std::literals;
...
它在 Windows 上使用 MSVC 编译良好,甚至在 OS X 上使用 clang 编译,但在使用 gcc 和英特尔的 icpc 的 redhat 7 上失败。
some more detail:
the system
cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
gcc version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Intel compiler version
icpc --version
icpc (ICC) 16.0.3 20160415
Copyright (C) 1985-2016 Intel Corporation. All rights reserved.
compiler call
gcc filename.cpp -std=c++1y
icpc filename.cpp -std=c++14
我错过了什么?
ps:即使像 in this live demo 这样的简单代码也不起作用:(
GCC 4.8.x 附带的 libstdc++ 没有这些文字; they started shipping beginning with GCC 4.9.0.