ubuntu下c++11的支持问题
来源:互联网 发布:python rqalpha 编辑:程序博客网 时间:2024/05/16 13:40
使用g++ -o test test.cpp编译程序c++程序时,由于使用了c++11的特性,所以在ubuntu下会报错如下:
test.cpp: In function ‘int main()’:
test.cpp:11:11: error: ‘inter’ does not name a type
for(auto inter=v.begin();inter!=v.end();inter++)
^
test.cpp:11:27: error: expected ‘;’ before ‘inter’
test.cpp: In function ‘int main()’:
test.cpp:11:11: error: ‘inter’ does not name a type
for(auto inter=v.begin();inter!=v.end();inter++)
^
test.cpp:11:27: error: expected ‘;’ before ‘inter’
for(auto inter=v.begin();inter!=v.end();inter++)
其实g++是支持c++11特性的,解决办法就是加上编译命令-std=c++11:
g++ -o test test.cpp -std=c++11
0 0
- ubuntu下c++11的支持问题
- Ubuntu下对双显卡的支持问题
- ubuntu 下 gd 的支持
- ubuntu下exfat的支持
- ubuntu下libjson-c库的使用问题备忘
- Linux学习笔记(4)----在Ubuntu下使用FileZilla的中文支持问题的解决
- ubuntu下的eclipse支持GBK编码
- ubuntu 下make menuconfig的支持
- 查看Ubuntu下支持的gcc版本号
- sublimText3在ubuntu下的中文支持
- ubuntu环境下 python 3.0以上版本对sqlite3的支持问题
- 关于ubuntu网卡支持问题的解决办法
- ubuntu下支持rar格式,并解决乱码问题
- ubuntu下virtalbox5.1.4安装usb支持问题
- Ubuntu中文支持问题
- Ubuntu下的终端中文问题 - [Ubuntu]
- ubuntu下分区的问题
- Xerces-C 2.10]GB2312支持的问题
- Linux下编写第一个c语言程序hello world
- cccc L2-009. 抢红包
- java 基本数据类型
- openssl命令详解
- Nuc
- ubuntu下c++11的支持问题
- JVM学习01-基本结构
- [算法练习]快速排序的C语言实现
- LeetCode 495. Teemo Attacking
- C语言中的scanf的使用
- 程序的机器级表示(IA32,AT&T,一)
- hashMap实现原理
- C/C++ #include<> 和 #include""的区别
- ubuntu 16.04 启用root用户方法