gcc编译c++的选项以及gcc与g++编译c++代码的区别
来源:互联网 发布:windows xp自动安装 编辑:程序博客网 时间:2024/05/29 02:39
$ gcc --help
-x <language> Specify the language of the following input files
Permissible languages include: c c++ assembler none
'none' means revert to the default behavior of
guessing the language based on the file's extension
$g++ --help
-x <language> Specify the language of the following input files
Permissible languages include: c c++ assembler none
'none' means revert to the default behavior of
guessing the language based on the file's extension
Compiling C++ Programs
C++ source files conventionally use one of the suffixes .C, .cc, .cpp, .CPP, .c++, .cp, or .cxx; C++ header files oftenuse .hh, .hpp, .H, or (for shared template code) .tcc; and preprocessed C++ files use the suffix .ii. GCC recognizes
files with these names and compiles them as C++ programs even if you call the compiler the same way as for compiling C
programs (usually with the name gcc).
However, the use of gcc does not add the C++ library. g++ is a program that calls GCC and automatically specifies
linking against the C++ library. It treats .c, .h and .i files as C++ source files instead of C source files unless -x
is used. This program is also useful when precompiling a C header file with a .h extension for use in C++ compilations.
On many systems, g++ is also installed with the name c++.
When you compile C++ programs, you may specify many of the same command-line options that you use for compiling programs
in any language; or command-line options meaningful for C and related languages; or options that are meaningful only for
C++ programs.
gcc 如果指定 -xc++ 就会将输入文件认为是c++文件 g++也有对应选项
gcc不会自动链接c++库,g++在调用gcc时自动链接的是c++库
- gcc编译c++的选项以及gcc与g++编译c++代码的区别
- C/C++ gcc g++编译的区别
- 【C++】gcc/g++ 链接库的编译与链接
- gcc g++编译选项
- gcc g++编译选项
- g++/gcc编译选项
- gcc/g++ 编译选项
- gcc 的编译选项
- gcc 的编译选项
- C语言gcc编译过程以及常用编译选项
- gcc 的编译选项以及调试
- [C++] gcc/g++ 命令的常用选项
- [GCC for C]编译选项---IDE掩盖下的天空
- [GCC for C++]编译选项---IDE掩盖下的天空
- [GCC for C]编译选项---IDE掩盖下的天空
- 关于g++(gcc)编译c/c++的学习笔记
- gcc和g++的区别以及extern "C"的作用
- [编译环境][gcc]16位程序中汇编代码与C语言代码的混合编译
- 欢迎使用CSDN-markdown编辑器
- Trace文件的格式
- 无法启动Genymotion,出现VirtualBox错误码:0x80004005 解决方法
- public class Demo02<T> implements IStoreAsList<T>
- android7.0关于TelephonyManager.getDeviceId()返回null的问题
- gcc编译c++的选项以及gcc与g++编译c++代码的区别
- 1044. Shopping in Mars (25)
- Scrapy定向爬虫教程(六)——分析表单并回帖
- JS Version Test
- AJAX全选、反选、全不选、删除、批量删除、即点即改
- ndk r9d环境配置
- cp后文件时间会变, mv后文件时间不会变化------定位一个低概率core问题时, 差点误导了自己
- 动态引入“”和<>文件
- Android动画之进度条