G++ 版本问题
来源:互联网 发布:svn linux登录 编辑:程序博客网 时间:2024/06/06 02:27
请按 ENTER 或其它命令继续
ReverseofString.cpp: In member function ‘std::string Solution::reveseVowels(std::string)’:
ReverseofString.cpp:10:14: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
set<char> hash1{'a','e','i','o','u','A','E','I','O','U'};
^
ReverseofString.cpp:10:59: error: in C++98 ‘hash1’ must be initialized by constructor, not by ‘{...}’
set<char> hash1{'a','e','i','o','u','A','E','I','O','U'};
^
ReverseofString.cpp:10:59: error: no matching function for call to ‘std::set<char>::set(<brace-enclosed initializer list>)’
ReverseofString.cpp:10:59: note: candidates are:
In file included from /usr/include/c++/4.8/set:61:0,
from ReverseofString.cpp:3:
/usr/include/c++/4.8/bits/stl_set.h:193:7: note: std::set<_Key, _Compare, _Alloc>::set(const std::set<_Key, _Compare, _Alloc>&) [with _Key = char; _Compare = std::less<char>; _Alloc = std::allocator<char>]
set(const set& __x)
^
/usr/include/c++/4.8/bits/stl_set.h:193:7: note: candidate expects 1 argument, 10 provided
/usr/include/c++/4.8/bits/stl_set.h:180:2: note: template<class _InputIterator> std::set<_Key, _Compare, _Alloc>::set(_InputIterator, _InputIterator, const _Compare&, const allocator_type&)
set(_InputIterator __first, _InputIterator __last,
^
/usr/include/c++/4.8/bits/stl_set.h:180:2: note: template argument deduction/substitution failed:
ReverseofString.cpp:10:59: note: cannot convert ‘'i'’ (type ‘char’) to type ‘const std::less<char>&’
set<char> hash1{'a','e','i','o','u','A','E','I','O','U'};
^
In file included from /usr/include/c++/4.8/set:61:0,
from ReverseofString.cpp:3:
/usr/include/c++/4.8/bits/stl_set.h:163:2: note: template<class _InputIterator> std::set<_Key, _Compare, _Alloc>::set(_InputIterator, _InputIterator)
set(_InputIterator __first, _InputIterator __last)
^
/usr/include/c++/4.8/bits/stl_set.h:163:2: note: template argument deduction/substitution failed:
ReverseofString.cpp:10:59: note: candidate expects 2 arguments, 10 provided
set<char> hash1{'a','e','i','o','u','A','E','I','O','U'};
^
In file included from /usr/include/c++/4.8/set:61:0,
from ReverseofString.cpp:3:
/usr/include/c++/4.8/bits/stl_set.h:148:7: note: std::set<_Key, _Compare, _Alloc>::set(const _Compare&, const allocator_type&) [with _Key = char; _Compare = std::less<char>; _Alloc = std::allocator<char>; std::set<_Key, _Compare, _Alloc>::allocator_type = std::allocator<char>]
set(const _Compare& __comp,
^
/usr/include/c++/4.8/bits/stl_set.h:148:7: note: candidate expects 2 arguments, 10 provided
/usr/include/c++/4.8/bits/stl_set.h:139:7: note: std::set<_Key, _Compare, _Alloc>::set() [with _Key = char; _Compare = std::less<char>; _Alloc = std::allocator<char>]
set()
^
/usr/include/c++/4.8/bits/stl_set.h:139:7: note: candidate expects 0 arguments, 10 provided
ReverseofString.cpp: In member function ‘std::string Solution::reveseVowels(std::string)’:
ReverseofString.cpp:10:14: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
set<char> hash1{'a','e','i','o','u','A','E','I','O','U'};
^
ReverseofString.cpp:10:59: error: in C++98 ‘hash1’ must be initialized by constructor, not by ‘{...}’
set<char> hash1{'a','e','i','o','u','A','E','I','O','U'};
^
ReverseofString.cpp:10:59: error: no matching function for call to ‘std::set<char>::set(<brace-enclosed initializer list>)’
ReverseofString.cpp:10:59: note: candidates are:
In file included from /usr/include/c++/4.8/set:61:0,
from ReverseofString.cpp:3:
/usr/include/c++/4.8/bits/stl_set.h:193:7: note: std::set<_Key, _Compare, _Alloc>::set(const std::set<_Key, _Compare, _Alloc>&) [with _Key = char; _Compare = std::less<char>; _Alloc = std::allocator<char>]
set(const set& __x)
^
/usr/include/c++/4.8/bits/stl_set.h:193:7: note: candidate expects 1 argument, 10 provided
/usr/include/c++/4.8/bits/stl_set.h:180:2: note: template<class _InputIterator> std::set<_Key, _Compare, _Alloc>::set(_InputIterator, _InputIterator, const _Compare&, const allocator_type&)
set(_InputIterator __first, _InputIterator __last,
^
/usr/include/c++/4.8/bits/stl_set.h:180:2: note: template argument deduction/substitution failed:
ReverseofString.cpp:10:59: note: cannot convert ‘'i'’ (type ‘char’) to type ‘const std::less<char>&’
set<char> hash1{'a','e','i','o','u','A','E','I','O','U'};
^
In file included from /usr/include/c++/4.8/set:61:0,
from ReverseofString.cpp:3:
/usr/include/c++/4.8/bits/stl_set.h:163:2: note: template<class _InputIterator> std::set<_Key, _Compare, _Alloc>::set(_InputIterator, _InputIterator)
set(_InputIterator __first, _InputIterator __last)
^
/usr/include/c++/4.8/bits/stl_set.h:163:2: note: template argument deduction/substitution failed:
ReverseofString.cpp:10:59: note: candidate expects 2 arguments, 10 provided
set<char> hash1{'a','e','i','o','u','A','E','I','O','U'};
^
In file included from /usr/include/c++/4.8/set:61:0,
from ReverseofString.cpp:3:
/usr/include/c++/4.8/bits/stl_set.h:148:7: note: std::set<_Key, _Compare, _Alloc>::set(const _Compare&, const allocator_type&) [with _Key = char; _Compare = std::less<char>; _Alloc = std::allocator<char>; std::set<_Key, _Compare, _Alloc>::allocator_type = std::allocator<char>]
set(const _Compare& __comp,
^
/usr/include/c++/4.8/bits/stl_set.h:148:7: note: candidate expects 2 arguments, 10 provided
/usr/include/c++/4.8/bits/stl_set.h:139:7: note: std::set<_Key, _Compare, _Alloc>::set() [with _Key = char; _Compare = std::less<char>; _Alloc = std::allocator<char>]
set()
^
/usr/include/c++/4.8/bits/stl_set.h:139:7: note: candidate expects 0 arguments, 10 provided
出现上述错误在编译C++时加上with -std=c++11 or -std=gnu++11
这个是因为编译器版本的问题
如下编译
g++ removeDupLe.cpp -o removeDupLe -std=gnu++11
./removeDupLe
0 0
- G++ 版本问题
- qt/embedded 安装笔记 关于 gcc g++ 的版本问题
- Linux的gcc和g++的版本切换问题
- Ubuntu 关于gcc/g++版本更换以及编译问题
- Nand从2G-〉4G版本时的一些问题
- g++: error: unrecognized option '--no-undefined' gcc、g++版本过高问题
- g++ 3.4 版本occi
- Openstack G版本
- 修改gcc、g++版本
- gcc/g++版本转换
- gcc g++版本降级
- oracle11g、10g同时安装数据导入导出无法识别数据库版本问题
- oracle11g、10g同时安装数据导入导出无法识别数据库版本问题
- Oracle 10g 版本10.1.0对正则的支持问题
- 关于linux环境下GCC与g++编译器高低版本转换的问题
- 对于gcc/g++在ubuntu16.04系统中降版本问题
- gnu gcc g++ 版本 MinGW 版本关系
- centos 上更新g++版本
- mybatis/JDBC读取mysql数据库中CHAR(1)类型数据为空
- Scala IDE for Eclipse 解析代码错误
- d3.js——绘制动态中国地图
- 理解Fragment生命周期
- Java ConcurrentModificationException异常原因和解决方法
- G++ 版本问题
- 开启重力感应
- MySQL 通用查询日志(General Query Log)
- AR技术应用 の 照片透视效果
- 用window.dialogArguments时出现window.dialogArguments is undefined
- 协同过滤与内容过滤
- JAVA实现AES加密
- Eclipse常用快捷方式
- Mysql中的排序规则utf8_unicode_ci、utf8_general_ci的区别总结