zoukankan      html  css  js  c++  java
  • gcc 编译

    1.Gcc编译流程

    1)预处理

    gcc -E hello.c -o hello.i

    -o指目标文件.

    .i文件为已经过预处理的c原始程序

    2)编译

    gcc -S hello.i -o hello.s

    3)汇编

    gcc -c hello.s -o hello.o

    4)链接

    gcc hello.o -o hello

    gcc 编译选项

    -c 只是编译不链接,生成目标文件.o

    -S 只是编译不汇编,生成汇编代码

    -E 只进行预编译,不做其他处理

    -o file 把输出文件输出到file里

    -I dir 在头文件的搜索路径列表中添加dir目录

    -L dir 在库文件的搜索路径列表中添加dir目录

    -static 链接静态库

    -g 在可执行程序中包含标准调试信息

    -w 关闭所有告警

    -Wall 允许发出gcc提供的所有有用的报警信息

    -O2 优化代码

  • 相关阅读:
    nuc970连接jlink进行单步调试的设置
    alsa utils工具使用
    用arm-linux-gcc v4.3.4交叉编译Qt4.8.3
    LNMP分离式部署
    MHA(下)
    MHA(上)
    PXE自动装机
    JumpServer
    FTP
    DNS
  • 原文地址:https://www.cnblogs.com/sylar-liang/p/4299186.html
Copyright © 2011-2022 走看看