微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

获取错误“char16_t和char32_t未声明”

我正在Linux上开发一个C ++程序。 海湾合作委员会的版本是4.5.1 20100924.我想在我的程序中使用std :: atomic_int。 我已经包括了primefaces头如下:

include <atomic>

当我编译程序时,我得到以下错误

In file included from /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../include/c++/4.5.1/bits/atomic_base.h:87:0,from /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../include/c++/4.5.1/atomic:41,from ../Source/Main.h:33: /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../include/c++/4.5.1/bits/atomicfwd_cxx.h:107:25: error: 'char16_t' was not declared in this scope /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../include/c++/4.5.1/bits/atomicfwd_cxx.h:107:33: error: template argument 1 is invalid /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../include/c++/4.5.1/bits/atomicfwd_cxx.h:107:53: error: invalid type in declaration before ';' token /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../include/c++/4.5.1/bits/atomicfwd_cxx.h:110:25: error: 'char32_t' was not declared in this scope /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../include/c++/4.5.1/bits/atomicfwd_cxx.h:110:33: error: template argument 1 is invalid /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../include/c++/4.5.1/bits/atomicfwd_cxx.h:110:53: error: invalid type in declaration before ';' token

如果我包含<cstdint> ,我会得到相同的错误。 头文件uchar.h和cuchar.h不在我的系统上。 我该如何解决编译错误

先谢谢你。

shell脚本模板

在Windows Embedded Standard上通过批量或类似方式设置Internet时间服务器

ifstream创build文件,如果它不存在

如何优化std :: map insert()函数

Windows标准文件位置

如何成功使用RDAP协议而不是whois

XOPEN_SOURCE和信号处理

什么是横幅命令的处理?

如何pipeinput到sublimetext在Linux上?

输出redirect不适用于某个程序

编辑:

我错了。 只要将--std=c++0x传给g ++,就可以了。

您似乎没有在您的编译器中启用C ++ 11支持,或者您使用了未声明这些新类型的编译器。

对于char16_t和char32_t ,你不需要额外的包含。

g ++ howto:

键入g++ --version 。 如果它至少是4.4,那么它支持新的字符串文字 。 如果不是的话:你需要一个更新的编译器版本。

然后,确保将--std=c++0x或--std=c++11传递给编译器。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐