首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

g++ 4.8 auto does not name a type解决方案

2013-11-01 
g++ 4.8 auto does not name a type为什么auto关键字报这个错误呢#include test.h#include iostreamus

g++ 4.8 auto does not name a type

为什么auto关键字报这个错误呢

#include "test.h"
#include <iostream>

using namespace std;

int main(){
double dval = 3.14;
//double fval = 2.0;
//double &dval2 = dval;
//const double &dval3 = dval;
//double const *dval4 = &dval;
//int const i = 1;
auto x = dval;
}
c++11?auto auto c++11
[解决办法]
参数里加上 -std=c++11再试试
[解决办法]
引用:
参数里加上 -std=c++11再试试

+2

热点排行