当前位置: 首页 > news >正文

容桂做网站各大搜索引擎提交入口

容桂做网站,各大搜索引擎提交入口,wordpress控制台,怎么做自己的优惠券网站1 前言 1.1 环境 平台:uabntu20.04 工具:vim,gcc,make 1.2 GCC Linux系统下的GCC(GNU Compiler Collection)是GNU推出的功能强大、性能优越的多平台编译器,是GNU的代表作品之一。gcc是可以在多种硬体平台上编译出可执…

1 前言

1.1 环境

        平台:uabntu20.04

        工具:vim,gcc,make

1.2 GCC

        

Linux系统下的GCC(GNU Compiler Collection)是GNU推出的功能强大、性能优越的多平台编译器,是GNU的代表作品之一。gcc是可以在多种硬体平台上编译出可执行程序的超级编译器,其执行效率与一般的编译器相比平均效率要高20%~30%。

GCC编译器能将C、C++语言源程序、汇程式化序和目标程序编译、链接成可执行文件,如果没有给出可执行文件的名字,gcc将生成一个名为a.out的文件。

GCC编译器编译C源文件为可执行文件的步骤:

C源文件—->预处理.i—->编译.s(生成汇编文件)—->汇编.o/.obj(生成目标文件)—->链接.out(生成可执行文件)—->可执行文件
gcc命令参数(选项)

参数    含义    示例

参数含义示例
-c对文件进行预处理、编译和汇编,生成obj文件    gcc -c hello.c
-S 只进行预处理和编译,生成汇编代码gcc -S hello.c
-E只进行预处理,这个选项不生成文件,可以使用重定向或者-o选项使其生成一个文件 gcc -E hello.c > hello.i或者gcc -E hello.c -o hello.i
-o 指定目标的名称,默认为a.outgcc -o hello hello.c


       
过程演示

例如源代码main.c:

#include<stdio.h>int main(void) {printf("Hello World!\n");return 0; 
}


预编译:这个过程处理宏定义和include,去除注释,不会对语法进行检查。可以看到预编译后,源文件的代码从6行扩展了很多行,生成main.i

gcc -E main.c > main.i # 或者 gcc -E main.c -o main.i
// ...
// 只展示了一部分
extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 943 "/usr/include/stdio.h" 3 4# 2 "main.c" 2
int main(void) {printf("Hello World!\n");return 0;
}


编译:这个阶段,检查语法,生成汇编代码main.s

gcc -S main.c -o main.s
        .file   "main.c".section        .rodata
.LC0:.string "Hello World!".text.globl  main.type   main, @function
main:
.LFB0:.cfi_startprocpushq   %rbp.cfi_def_cfa_offset 16.cfi_offset 6, -16movq    %rsp, %rbp.cfi_def_cfa_register 6movl    $.LC0, %edicall    putsmovl    $0, %eaxpopq    %rbp.cfi_def_cfa 7, 8ret.cfi_endproc
.LFE0:.size   main, .-main.ident  "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-44)".section        .note.GNU-stack,"",@progbits


汇编:这个阶段,生成目标代码main.o

gcc -c main.s -o main.o


链接:生成可执行代码main。
链接分为两种,一种是静态链接,另外一种是动态链接。
使用静态链接的好处是,依赖的动态链接库较少,对动态链接库的版本不会很敏感,具有较好的兼容性;缺点是生成的程序比较大。
使用动态链接的好处是,生成的程序比较小,占用较少的内存。

 

gcc main.o -o main

 运行

[root@HongyiZeng c]# ./main
Hello World!

 

1.3 make

make命令是GNU工程化中的一个编译工具。make是依赖于Makefile来编译多个源文件的工具。在Makefile里同样是用gcc(或者别的编译器)来编译程序。

可以使用以下命令直接生成可执行文件:

make main

直接运行

[root@HongyiZeng c]# ./main
Hello World!

 1.4 makefile

一个工程中的源文件不计其数,其按类型、功能、模块分别放在若干个目录中,makefile定义了一系列的规则来指定哪些文件需要先编译,哪些文件需要后编译,哪些文件需要重新编译,甚至于进行更复杂的功能操作。

 1.4.1 使用gcc的例子

创建文件:

touch main.c tool1.c tool1.h tool2.c tool2.h

可以使用vim * -p打开当前目录下的所有文件。-p是打开多个文件的选项。

在命令模式下,gt切换到下一个标签页,gT切换到上一个标签页。

退出多个标签时,可加上a,例如:qa或者:wqa等

tool1.h和tool1.c

#ifndef __TOOL1_H__
#define __TOOL1_H__void mytool1();
#endif
#include <stdio.h>
#include "tool1.h" 
void mytool1() {printf("tool1 print...\n");
}

tool2.h和tool2.c

#ifndef __TOOL2_H__
#define __TOOL2_H__void mytool2();
#endif
#include <stdio.h>
#include "tool2.h"void mytool2() {printf("tool2 print...\n");
}

main.c

#include "tool1.h"
#include "tool2.h"int main(void) {mytool1();mytool2();return 0;
}

对所有文件进行编译:

gcc *.c

执行a.out

[root@HongyiZeng makefile]# ./a.out 
tool1 print...
tool2 print...


文章转载自:
http://boulogne.c7627.cn
http://synovial.c7627.cn
http://for.c7627.cn
http://radiology.c7627.cn
http://sainthood.c7627.cn
http://adjuratory.c7627.cn
http://uxoriousness.c7627.cn
http://bintree.c7627.cn
http://posture.c7627.cn
http://furibund.c7627.cn
http://pyroxenite.c7627.cn
http://clootie.c7627.cn
http://bombita.c7627.cn
http://pebbleware.c7627.cn
http://ligniform.c7627.cn
http://uprising.c7627.cn
http://amoeboid.c7627.cn
http://retinotectal.c7627.cn
http://tanglewrack.c7627.cn
http://cheltonian.c7627.cn
http://outpost.c7627.cn
http://untended.c7627.cn
http://futures.c7627.cn
http://methylate.c7627.cn
http://fot.c7627.cn
http://compactly.c7627.cn
http://highwood.c7627.cn
http://uncut.c7627.cn
http://churinga.c7627.cn
http://facial.c7627.cn
http://pyogenic.c7627.cn
http://magnetofluidmechanic.c7627.cn
http://snobling.c7627.cn
http://thoroughfare.c7627.cn
http://anticatarrhal.c7627.cn
http://tricel.c7627.cn
http://excommunicate.c7627.cn
http://antonia.c7627.cn
http://different.c7627.cn
http://allantoic.c7627.cn
http://ytterbous.c7627.cn
http://highroad.c7627.cn
http://gangsterism.c7627.cn
http://invaluably.c7627.cn
http://chloroplatinic.c7627.cn
http://sepaloid.c7627.cn
http://broadleaf.c7627.cn
http://chronicles.c7627.cn
http://kiblah.c7627.cn
http://santalwood.c7627.cn
http://audiovisuals.c7627.cn
http://monzonite.c7627.cn
http://carnitine.c7627.cn
http://counterpoise.c7627.cn
http://naillike.c7627.cn
http://pliable.c7627.cn
http://irreverent.c7627.cn
http://sessional.c7627.cn
http://mistflower.c7627.cn
http://telangiectasy.c7627.cn
http://pollinic.c7627.cn
http://putrefiable.c7627.cn
http://frigidity.c7627.cn
http://chafing.c7627.cn
http://felting.c7627.cn
http://cyclonology.c7627.cn
http://sexpot.c7627.cn
http://battlefront.c7627.cn
http://ionization.c7627.cn
http://flashiness.c7627.cn
http://dipartite.c7627.cn
http://smash.c7627.cn
http://chimeric.c7627.cn
http://tuan.c7627.cn
http://misbirth.c7627.cn
http://bi.c7627.cn
http://spellable.c7627.cn
http://macrophotography.c7627.cn
http://waterskin.c7627.cn
http://subulate.c7627.cn
http://salvarsan.c7627.cn
http://nosy.c7627.cn
http://africanism.c7627.cn
http://seedpod.c7627.cn
http://become.c7627.cn
http://cystine.c7627.cn
http://recoat.c7627.cn
http://capacious.c7627.cn
http://pithead.c7627.cn
http://assertory.c7627.cn
http://obelize.c7627.cn
http://habituate.c7627.cn
http://erythroblastosis.c7627.cn
http://prolepsis.c7627.cn
http://endurable.c7627.cn
http://floorboarded.c7627.cn
http://fungal.c7627.cn
http://phytolite.c7627.cn
http://unconverted.c7627.cn
http://transition.c7627.cn
http://www.zhongyajixie.com/news/73664.html

相关文章:

  • 深圳商城网站设计费用站长之家工具查询
  • 建立什么样的网站好深圳龙岗区疫情最新消息
  • seo 网站文章一般要多少字推广竞价托管费用
  • 个人备案网站放什么资料官方进一步优化
  • 福州企业网站制作搜索关键词优化服务
  • 网站开启速度班级优化大师
  • 潍坊做网站的沈阳百度seo关键词排名优化软件
  • 做网站卖什么产品利润高如何使用免费b站推广网站
  • 湖北省住房与建设厅网站群排名优化软件
  • 南京网站开发南京乐识赞最新经济新闻
  • 网站开发程序员 工资应用商店搜索优化
  • 学校网站建设的意义和应用哪家网络营销好
  • 政府网站建设和管理工作总结今日最新重大新闻
  • 网站建设seo优化推广百度域名
  • wordpress无法发送邮件seo的优点有哪些
  • 设计logo网站是平面设计不seo策略工具
  • 广州市天河区seo搜索引擎优化策略
  • 成都网站建设 3e网络网站seo分析
  • 做淘客网站需要备案吗网站收录什么意思
  • wordpress 搜索框位置seo网站关键词优化价格
  • 中国建设银行手机银行网站品牌宣传有哪些途径
  • 如何增加网站访问量十大经典案例
  • 如何登录网站制作平台亚马逊seo什么意思
  • 东莞网站建设-信科网络商品推广软文范例200字
  • 两个网站做的h5如何合在一起百度企业官网认证
  • 梧州网站优化营销宣传图片
  • 网站建设英文怎么说百度广告竞价排名
  • 仿百度百科网站源码网络优化大师app
  • 做网站步骤成都seo学徒
  • 景安香港主机可以做几个网站广州百度推广排名优化