GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — CoderNoteBook/note/linux命令_gcc.md at master · zhaozhengcoder/CoderNoteBook

Expand file tree

/

linux命令_gcc.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
60 lines (33 loc) · 960 Bytes
/

linux命令_gcc.md

Copy path

File metadata and controls

executable file
·
60 lines (33 loc) · 960 Bytes
Raw
Copy raw file
Download raw file
Edit and raw actions

gcc 的参数

总结一些我用到的一些参数

-E

预处理(但是,它的输出是直接输出到终端,最好重定向一下)

(对于学c++的同学,可以留意一些这个文件,c++的这个include的机制,展开之后是会编程一个比较大的文件)
gcc -E hello.c > hello.txt

-c

只激活预处理,编译,和汇编,也就是他只把程序做成obj文件 
gcc -c hello.c 

-o

制定目标名称,缺省的时候,gcc 编译出来的文件是a.out

-I

指定查找头文件的路径

-L

指定链接文件或者是库的路径

-l

链接库的名字,比如 -lpthread ,lmuduo 

-M

目标文件所依赖的所有源代码

-O

-O0

-O1 

-O2 

-O3 

编译器的优化选项的4个级别,-O0表示没有优化,-O1为缺省值,-O3优化级别最高

-Wall

生成所有警告信息

-fno-elide-constructors

关闭返回值优化效果
You are visitor 01402622 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.