warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11

简介: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11

有以下报警:

warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11

吾见报警,必去之。这个怎么去?根据提示即可。加上编译参数:

gcc  -std=c++11
g++  -std=c++11

如果是VS呢?评论中有网友说:

Project->Properties->C++ Build->Misc Options加上即可。

目录
相关文章
|
2月前
|
编译器 程序员 API
【踩坑记录】解决GCC 中C++ 17 的 std::filesystem 链接报错:undefined reference to `std::filesystem::path
【踩坑记录】解决GCC 中C++ 17 的 std::filesystem 链接报错:undefined reference to `std::filesystem::path
70 4
|
2月前
|
算法 前端开发 大数据
【C/C++ 基础知识 】C++中易混淆的函数和关键字:std::find vs std::search,std::remove vs std::erase,remove vs delete
【C/C++ 基础知识 】C++中易混淆的函数和关键字:std::find vs std::search,std::remove vs std::erase,remove vs delete
36 0
VS2005 error C2864 only static const integral data members can be initialized within a class
VS2005 error C2864 only static const integral data members can be initialized within a class
|
11月前
|
iOS开发 MacOS
MacOS Clion 使用<bits/stdc++.h>万能头提示 fatal error: ‘bits/stdc++.h‘ file not found
MacOS Clion 使用<bits/stdc++.h>万能头提示 fatal error: ‘bits/stdc++.h‘ file not found
711 0
|
11月前
|
数据安全/隐私保护
fatal error: boost/algorithm/string.hpp: 没有那个文件或目录
fatal error: boost/algorithm/string.hpp: 没有那个文件或目录
124 0
|
C++
warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
137 0
解决AttributeError: ‘Namespace‘ object has no attribute ‘arch‘
解决AttributeError: ‘Namespace‘ object has no attribute ‘arch‘
659 0
error: ‘to_string‘ is not a member of ‘std‘ 或 error: ‘thread‘ is not a member of ‘std‘ 原因及解决办法
error: ‘to_string‘ is not a member of ‘std‘ 或 error: ‘thread‘ is not a member of ‘std‘ 原因及解决办法
1069 0
解决办法:error: ‘unordered_map’ in namespace ‘std’ does not name a template type
解决办法:error: ‘unordered_map’ in namespace ‘std’ does not name a template type
417 0