gcc 编译c++程序过程小练

534阅读 0评论2011-07-22 001xiaofei
分类:

[root@localhost p3.2]# vi p3.2.cpp

#include

#define MIN(A,B) ((A)>(B)?(B):(A))

int main(){

        int a;

        a=MIN(1,2);

        std:cout<<"the result is :"<

        return 0;

}

 

[root@localhost p3.2]# g++ -o p3.2 p3.2.cpp

[root@localhost p3.2]# ls

p3.2  p3.2.cpp

[root@localhost p3.2]# ./p3.2

the result is :1

[root@localhost p3.2]# g++  -v -o p3.2 p3.2.cpp

#include "..." 搜索从这里开始:

#include <...> 搜索从这里开始:

 /usr/lib/gcc/i686-redhat-linux/4.4.4/../../../../include/c++/4.4.4

 /usr/lib/gcc/i686-redhat-linux/4.4.4/../../../../include/c++/4.4.4/i686-redhat-linux

 /usr/lib/gcc/i686-redhat-linux/4.4.4/../../../../include/c++/4.4.4/backward

 /usr/local/include

 /usr/lib/gcc/i686-redhat-linux/4.4.4/include

 /usr/include

搜索列表结束。

GNU C++ (GCC) 版本 4.4.4 20100630 (Red Hat 4.4.4-10) (i686-redhat-linux)

        GNU C 版本 4.4.4 20100630 (Red Hat 4.4.4-10) 编译,GMP 版本 4.3.1MPFR 版本 2.4.1

GGC 准则:--param ggc-min-expand=98 --param ggc-min-heapsize=128385

Compiler executable checksum: d1832f590f8c33a04608ef07eca3d070

COLLECT_GCC_OPTIONS='-v' '-o' 'p3.2' '-shared-libgcc' '-mtune=generic' '-march=i686'

 as -V -Qy -o /tmp/ccXaVeUz.o /tmp/ccfioQ19.s

GNU assembler version 2.19.51.0.14 (i686-redhat-linux) using BFD version version 2.19.51.0.14-37.fc12 20090722

上一篇:【PDF】《C++ Primer (3RD)中文版》清晰版
下一篇:makefile 练习一