刘总的笔记小站

生活常识,娱乐搞笑,编程技巧,智能家居,深度学习,网络神经,数据挖掘

GCC 编译 -std简述

用GCC编译代码时候后面带有-std=c++1z 的选项,这是指定c/c++的标准.具体的标准如下,详细信息可以看引用里面的详细说明


c

standdescript
-std=c90 or -std=iso9899:1990称为C89或C90
-std=iso9899:199409称为C94或C95
-std=c99 or -std=iso9899:1999.1999年发布的 ISO/IEC 9899:1999,称为C99
-std=c11 or -std=iso9899:2011称为C11
-std=gnu90C90和GNU扩展
-std=gnu99C99和GNU扩展
-std=gnu11C11和GNU扩展


c++

standdescript
-std=c++98, or -std=c++03称为 C++98
-std=c++11称为C++11
-std=c++14称为C++14
-std=c++17 or -std=c++1z称为C++17
-std=gnu++98C++98和GNU扩展
-std=gnu++11C++11和GNU扩展
-std=gnu++14C++14和GNU扩展
-std=gnu++1zC++17和GNU扩展


引用

https://gcc.gnu.org/onlinedocs/gcc/Standards.html


gcc -O2 -std=c89 -Iinclude -Ldir -llib -o hello hello.c
g++ -O2 -std=c++11 -Iinclude -Ldir -llib -o hello hello.cpp


发表评论:

控制面板
您好,欢迎到访网站!
  查看权限
搜索
«   2024年9月   »
1
2345678
9101112131415
16171819202122
23242526272829
30
网站分类
最新留言
文章归档
网站收藏
友情链接
图标汇集
Powered by Z-BlogPHP

  • Copyright ©2021 @liuzong All rights reserved.
  • 陕ICP备17016542号