test.cpp
int main()
{
return 1;
}
1.gcc 编译报错
gcc test.cpp
/tmp/ccgGC04E.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
2.g++编译通过
g++ test.cpp
3.改扩展名(test.c)后gcc可以编译通过
gcc test.c
4.添加链接库(lstdc++)后,gcc可以编译通过
gcc -lstdc++ test.cpp
原因:
文件名:
file.c
C source code which must be preprocessed.
file.cpp
C++ source code which must be preprocessed. Note that in .cxx, the last two letters must both be literally x.
Likewise, .C refers to a literal capital C.
附录:
file.c
C source code which must be preprocessed.
file.i
C source code which should not be preprocessed.
file.ii
C++ source code which should not be preprocessed.
file.m
Objective-C source code. Note that you must link with the libobjc library to make an Objective-C program work.
file.mi
Objective-C source code which should not be preprocessed.
file.mm
file.M
Objective-C++ source code. Note that you must link with the libobjc library to make an Objective-C++ program work.
Note that .M refers to a literal capital M.
file.mii
Objective-C++ source code which should not be preprocessed.
file.h
C, C++, Objective-C or Objective-C++ header file to be turned into a precompiled header.
file.cc
file.cp
file.cxx
file.cpp
file.CPP
file.c++
file.C
C++ source code which must be preprocessed. Note that in .cxx, the last two letters must both be literally x.
Likewise, .C refers to a literal capital C.
file.mm
file.M
Objective-C++ source code which must be preprocessed.
file.mii
Objective-C++ source code which should not be preprocessed.
file.hh
file.H
file.hp
file.hxx
file.hpp
file.HPP
file.h++
file.tcc
C++ header file to be turned into a precompiled header.
file.f
file.for
file.ftn
Fixed form Fortran source code which should not be preprocessed.
file.F
file.FOR
file.fpp
file.FPP
file.FTN
Fixed form Fortran source code which must be preprocessed (with the traditional preprocessor).
file.f90
file.f95
file.f03
file.f08
Free form Fortran source code which should not be preprocessed.
file.F90
file.F95
file.F03
file.F08
Free form Fortran source code which must be preprocessed (with the traditional preprocessor).
file.ads
Ada source code file which contains a library unit declaration (a declaration of a package, subprogram, or generic,
or a generic instantiation), or a library unit renaming declaration (a package, generic, or subprogram renaming
declaration). Such files are also called specs.
file.adb
Ada source code file containing a library unit body (a subprogram or package body). Such files are also called
bodies.
file.s
Assembler code.
file.S
file.sx
Assembler code which must be preprocessed.
分享到:
相关推荐
对gcc g++中编译选项的详细中文解释。
基与Linux-ARM版的GCC,现在移植到了安卓。压缩包中有必要的软件和用法,这样就可以在安卓上体验GCC和G++了
记录Linux中gcc/g++常用编译选项,有很详细的使用说明
编译C++程序要安装g++ gcc-c++-3.4.6-3.i386.rpm libstdc++-devel-3.4.6-8.i386.rpm libstdc++-3.4.6-8.i386.rpm install.sh的内容 rpm -Uvh glibc-kernheaders-2.4-9.1.103.EL.i386.rpm --nodeps --force ...
MinGW 自动安装工具下载于Http://sourceforge.net/project/showfiles.php?group_id=2435 在安装过程中会从网络上下载安装包,如果网络不好可能会出现安装失败等现象。
g++编译命令选项.本文讨论GNU编译器集合(GCC)中的C++编译器(g++)的典型用法,主要是指命令行选项的构造。GCC的C++编译器正常安装后,可以使用g++或c++命令执行。
提供了在干净的centos7下安装gcc和g++的编译环境,同时给出了相关的包路径和安装步骤。按着步骤安装就可以完成了特定的环境了
mingw64编译i器,gcc,g++编译,版本4.9.2,可用作matlab编译器,vscode编译器
gcc/g++在执行编译工作的时候,总共需要4步 1.预处理,生成.i 的文件[预处理器cpp] 2.将预处理后的文件不转换成汇编语言,生成文件.s[编译器egcs] 3.有汇编变为目标代码(机器代码)生成.o 的文件[汇编器as] 4.连接目标...
unzip g++.zip cd g++ rpm -Uvh *.rpm gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)
gcc g++ tcl make ubuntu安装编译环境 使用命令 sudo dpkg -i *.deb 安装
gcc g++ 编译源文件的简单实例,一学就会。
GCC/G++编译命令 GCC/G++编译器没有图形界面,只能在终端上以命令方式运行。编译命令由命令名、选项和源文件名组成,格式如下所示: gcc [-选项 1] [-选项 2]…[-选项 n] <源文件名> g++ [-选项 1] [-选项 2]…[-...
GCC_G++编译命令选项.pdf;GCC.中文手册.pdf;GNU_makefile中文手册.pdf
gcc,g++ GNU C 手册,包括各种调试命令,选项,让你迅速掌握gcc g++进行开发. .c C源程序;预处理,编译,汇编 .C C++源程序;预处理,编译,汇编 .cc C++源程序;预处理,编译,汇编 .cxx C++源程序;预处理,编译,汇编 .m ...
功能:支持在ubuntu 上编译 tar.gz源码安装软件 编辑器安装方式:1.下载包,2.放到缓存目录/var/cache/apt/archives/,3.sudo apt-get install gcc ; sudo apt-get install g++ 4.这样不会再链接到软件库下载.直接读取...
介绍常用GCC常用编译选项,让你轻松在linux环境下开发程序.
给g++编译输出的结果加上色彩,warning、error一目了然
红联Linux门户|Linux通用技术|Linux发行版技术|Linux企业应用|Linux实验室|红联Linux论坛Linux系统教程Linux入门Linux