linux g++编译选项,g++常用编译选项(G++ common compile options).doc

g常用编译选项(Gcommoncompileoptions)

g++常用编译选项(G++ common compile options)

Compile options for GCC and g++ in Linux

-x language filename

Use the file set language, the suffix name is invalid, the more effective later. That is according to the agreement, C language suffix name is.C, and the C++ suffix is.C or.Cpp, if you have a personality, determine your C code file name suffix is.Pig ha ha, you to use this parameter, the parameters of the file names behind him play, unless the use of a parameter. The parameters you can use have the following:

`c', `objective-c', `c-header', `c++', `cpp-output', `assembler', and, `a

Ssembler-with-cpp'.

It should be understandable to see english.

Example use: cd..

GCC -x C hello.pig

-x none filename

Turn off the last option, that is, GCC automatically identifies the file type based on the file name suffix

Example usage:

GCC, -x, C, hello.pig, -x, none, hello2.c

-c

Activation, preprocessing, compilation, and assembly only, that is, he only makes programs into obj files

Example usage:

GCC -c hello.c

He will generate the.O obj file

-S

Activation, preprocessing, and compilation only refer to the compilation of files into assembly code.

Example usage

GCC -S hello.c

He will generate the assembly code for.S, which you can look at in a text editor

-E

Activate preprocessing only. This does not generate files, and you need to redirect it to an output file

Example usage:

GCC, -E, hello.c > pianoapan.txt

GCC -E hello.c more |

Take a look at it. A hello word also needs to be pre processed into 800 lines of code

-o

Set the target name. By default, the GCC compiles the file is a.out. It's hard to hear. If you feel the same way, get rid of it, ha ha

Example usage

GCC, -o, hello.exe, hello.c (oh, windows used it)

GCC, -o, hello.asm, -S, hello.c

-pipe

Using pipes instead of temporary files in compilation can be a problem when using non - GNU assembly tools

GCC, -pipe, -o, hello.exe, hello.c

-ansi

Close the incompatibility in GNU C with ANSI C to activate the proprietary features of ANSI

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值