-std=gnu++11 导致的问题
来源:互联网 发布:js 字符串操作 编辑:程序博客网 时间:2024/06/07 15:52
今天打算在自己新的C++工程中启用C++11, 到时候了,该全面升级了。
编译器是GCC4.8.1, 查看官方文档:http://gcc.gnu.org/onlinedocs/gcc-4.8.1/libstdc++/manual/manual/using.html#manual.intro.using.flags
看到可以使用的选项是-std=gnu++11,结果编译报错,都是:
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/type_traits:268:39: error: use of undeclared identifier '__float128' struct __is_floating_point_helper<__float128>
打开type_traits文件,找到268行左右的代码:
#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128) template<> struct __is_floating_point_helper<__float128> : public true_type { };#endif
根据Google的结果,有个解决方案:
一是换用--std=c++11,问题解决。
二是使用__STRCT_ANSI__
编译选项中添加了-D__STRICT_ANSI__后,果然问题解决。
另外,安装了clang3.2后,由于兼容gcc所有参数,编译时只需要将c++命令换成clang++即可。都知道clang编译快,报错友好。等到发布的时候,再换成gcc,获得更快的性能。还是不错的用法。
- -std=gnu++11 导致的问题
- 关于-std=gnu++11的一篇文章
- 问题:cc1plus.exe: error: unrecognized command line option '-std=gnu++11' compilation terminated due to
- mod_tile编译出错 -std=c++11 or -std=gnu++11
- Linuxg++编译C++代码出错 -std=c++11 or -std=gnu++11
- 关于std::shared_ptr与std::enable_shared_from_this循环引用导致的问题
- cmake+gcc解决extended initializer lists only available with -std=c++11 or -std=gnu++11
- 关于make提示must be enabled with the -std=c++11 or -std=gnu++11 compiler options
- 我晕,一个低级错误导致我DEBUG两天(std::string c_str()的问题)
- C++ std::sort导致的core dumped
- 使用std::sort()排序导致程序core问题分析
- 使用std::sort()排序导致程序core问题分析
- 使用std::sort()排序导致程序core问题分析
- 使用std::sort()排序导致程序core问题分析
- vs2005 std::locale 的问题
- std::locale::global 的问题
- std::string crash的问题
- std::istream&初始化的问题
- 远程监视jboss应用java内存的配置(实测)
- Spring 事务管理
- 55555555555555555
- 多寄存器寻址指令ldmia/ldmib和ARM存储器访问指令——多寄存器存取
- 在地图上标记
- -std=gnu++11 导致的问题
- c语言学生证管理系统(有待改进)
- 面试题目集合
- 用python修改文本内容
- 正斜杠(/)与反斜杠(\)总结
- hdu 2136(Largest prime factor)
- WM_DRAWITEM与DrawItem()的讨论
- 如果这不美,什么算美
- Win32