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

网站登陆系统怎么做建模网

网站登陆系统怎么做,建模网,修改wordpress后台登录,做美食视频网站有哪些目录 一、编译原理概述 二、编译过程分析 三、编译动静态库 四、执行过程分析 一、编译原理概述 make#xff1a; 一个GCC工具程序#xff0c;它会读 makefile 脚本来确定程序中的哪个部分需要编译和连接#xff0c;然后发布必要的命令。它读出的脚本#xff08;叫做 …目录 一、编译原理概述 二、编译过程分析 三、编译动静态库 四、执行过程分析 一、编译原理概述 make 一个GCC工具程序它会读 makefile 脚本来确定程序中的哪个部分需要编译和连接然后发布必要的命令。它读出的脚本叫做 makefile 或 Makefile定义了文件关系和依赖关系。 # 查看GCC默认头文件搜索路径echo | gcc -v -x c -E - #include stdio.hint main() {printf(hello, world\n);return 0; } hello 程序的生命周期是从一个源程序或者说源文件开始的即程序员通过编辑器创建并保存的文本文件文件名是 hello.c。源程序实际上就是一个由值 0 和 1组成的位又称为比特序列8 个位被组织成一组称为字节。每个字节表示程序中的某些文本字符。 大部分计算机使用 ASCII 标准来表示文本字符 用一个唯一的单字节大小的整数值息来表示每个字符hello.c 程序是以字节序列的方式储存在文件中的 hello.c 的表示方法说明了一个基本思想系统中所有的信息——包括磁盘文件、内存中的程序、内存中存放的用户数据以及网络上传送的数据都是由一串比特表示的。 二、编译过程分析 hello 程序的生命周期从一个高级 C 语言程序开始。 为了在系统上运行 hello.c 程序每条 C 语句都必须被其他程序转化为一系列的低级机器语言指令。 然后这些指令按照一种称为可执行目标程序的格式打好包并以二进制磁盘文件的形式存放起来。 GCC 编译器读取源程序文件 hello.c并把它翻译成一个可执行目标文件 hello。这个翻译过程可分为四个阶段完成如下图所示 执行这四个阶段的程序预处理器、编译器、汇编器和链接器一起构成了编译系统compilation system。 # 预处理 Preprocessing # -E 选项告诉编译器只进行预处理操作 # -o 选项把预处理的结果输出到指定文件(base) [rootlocalhost 01_test]# vim hello.c (base) [rootlocalhost 01_test]# cat hello.c #include stdio.hint main() {printf(hello, world\n);return 0; } (base) [rootlocalhost 01_test]# gcc -E hello.c -o hello.i (base) [rootlocalhost 01_test]# ls hello.c hello.i (base) [rootlocalhost 01_test]# # 生成汇编语言 Generating Assembly Language # -S 选项告诉编译器进行预处理和编译成汇编语言操作(base) [rootlocalhost 01_test]# gcc -S hello.i -o hello.s (base) [rootlocalhost 01_test]# ls hello.c hello.i hello.s (base) [rootlocalhost 01_test]# cat hello.s.file hello.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 (base) [rootlocalhost 01_test]# # 源程序编译为目标程序 Source File to Object File # -c 选项告诉编译器将源代码或汇编代码翻译成二进制机器代码(base) [rootlocalhost 01_test]# ls hello.c hello.i hello.s (base) [rootlocalhost 01_test]# gcc -c hello.s -o hello.o (base) [rootlocalhost 01_test]# ls hello.c hello.i hello.o hello.s (base) [rootlocalhost 01_test]# cat hello.o ELF UH]hello, worldGCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-44)zRx P AChello.cmainputs .symtab.strtab.shstrtab.rela.text.data.bss.rodata.comment.note.GNU-stack.rela.eh_frame 0 90b.BWR 0a(base) [rootlocalhost 01_test]# # 可执行文件生成 Executable # -o 选项告诉编译器生成可执行文件(base) [rootlocalhost 01_test]# ls hello.c hello.i hello.o hello.s (base) [rootlocalhost 01_test]# gcc hello.o -o hello (base) [rootlocalhost 01_test]# ls hello hello.c hello.i hello.o hello.s (base) [rootlocalhost 01_test]# ./hello hello, world (base) [rootlocalhost 01_test]# # 我们也可以直接将源代码生成可执行文件 # 可以单个源文件生成可执行文件也可以多个源文件生成可执行文件(base) [rootlocalhost 01_test]# gcc hello.c -o hello (base) [rootlocalhost 01_test]# ls hello hello.c (base) [rootlocalhost 01_test]# ./hello hello, world (base) [rootlocalhost 01_test]# 源文件.c文件 - 预编译成.i文件 - 编译成汇编语言.s - 汇编成.o文件 - 链接成可执行文件。 三、编译动静态库 # 创建一个静态库 Create a Static Lib# 编译成 .o 文件 gcc -c [.c] -o [自定义文件名] gcc -c [.c] [.c] ...# 编静态库 ar -r [lib自定义库名.a] [.o] [.o] ...# 链接成可执行文件 gcc [.c] [.a] -o [自定义输出文件名] gcc [.c] -o [自定义输出文件名] -l[库名] -L[库所在路径](base) [rootlocalhost 02_test]# vim add.c (base) [rootlocalhost 02_test]# vim minus.c (base) [rootlocalhost 02_test]# cat add.c int add(int a, int b) {return a b; } (base) [rootlocalhost 02_test]# cat minus.c int minus(int a, int b) {return a - b; } (base) [rootlocalhost 02_test]# vim main.c (base) [rootlocalhost 02_test]# cat main.c #include stdio.hint add(int a, int b); int minus(int a, int b);int main() {int a 10;int b 5;printf(a b %d\n, add(a, b));printf(a - b %d\n, minus(a, b));return 0; } (base) [rootlocalhost 02_test]# gcc -c add.c -o add.o (base) [rootlocalhost 02_test]# gcc -c minus.c -o minus.o (base) [rootlocalhost 02_test]# ar -r mymathlib.a add.o minus.o ar: 正在创建 mymathlib.a (base) [rootlocalhost 02_test]# gcc main.c mymathlib.a -o math.exe (base) [rootlocalhost 02_test]# ./math.exe a b 15 a - b 5 (base) [rootlocalhost 02_test]# # 创建一个动态库 Create a Shared Lib# 编译成二进制 .o 文件 gcc -c -fpic [.c/.cpp][.c/.cpp]... # 编动态库 gcc -shared [.o][.o]... -o [lib自定义库名.so]# 链接库到可执行文件 gcc [.c/.cpp] -o [自定义可执行文件名] -l[库名] -L[库路径]# 告诉编译器动态库的位置 # 1. 安装不建议往系统库添加头文件 # 2. 添加环境变量重启后无效 # 3. 配置 /etc/ld.so.conf.d 文件永久有效 # 4. 建立软链接永久有效(base) [rootlocalhost 02_test]# gcc -c -fpic add.c minus.c (base) [rootlocalhost 02_test]# ls add.c add.o main.c minus.c minus.o (base) [rootlocalhost 02_test]# gcc -shared add.o minus.o -o libmymathlib.so (base) [rootlocalhost 02_test]# ls add.c add.o libmymathlib.so main.c minus.c minus.o (base) [rootlocalhost 02_test]# gcc main.c -o math -lmymathlib -L. (base) [rootlocalhost 02_test]# ls add.c add.o libmymathlib.so main.c math minus.c minus.o (base) [rootlocalhost 02_test]# ./math ./math: error while loading shared libraries: libmymathlib.so: cannot open shared object file: No such file or directory (base) [rootlocalhost 02_test]# pwd /root/gitee/Test/Make_Learn/02_test (base) [rootlocalhost 02_test]# rm math rm是否删除普通文件 mathy (base) [rootlocalhost 02_test]# gcc main.c -o math -lmymathlib -L/root/gitee/Test/Make_Learn/02_test (base) [rootlocalhost 02_test]# ./math ./math: error while loading shared libraries: libmymathlib.so: cannot open shared object file: No such file or directory (base) [rootlocalhost 02_test]# ln -s ./libmymathlib.so /lib64/libmymathlib.so (base) [rootlocalhost 02_test]# ./math ./math: error while loading shared libraries: libmymathlib.so: cannot open shared object file: Error 40 (base) [rootlocalhost 02_test]# pwd /root/gitee/Test/Make_Learn/02_test (base) [rootlocalhost 02_test]# ls /lib64/libmymathlib.so ls: 无法访问/lib64/libmymathlib.so: 符号连接的层数过多 (base) [rootlocalhost 02_test]# rm -rf /lib64/libmymathlib.so (base) [rootlocalhost 02_test]# ln -s /root/gitee/Test/Make_Learn/02_test/libmymathlib.so /lib64/libmymathlib.so (base) [rootlocalhost 02_test]# ./math a b 15 a - b 5 (base) [rootlocalhost 02_test]# 四、执行过程分析 第一步 shell 等待我们输入一个命令当我们在键盘上输入字符串./hello注意这里是编译好的可执行目标文件后shell 程序将字符逐一读入寄存器再把它存放到内存中 第二步 当我们在键盘上敲回车键时shell 程序就知道我们已经结束了命令的输人然后 shell 执行一系列指令来加载可执行的 hello 文件这些指令将 hello 目标文件中的代码和数据从磁盘复制到主存数据包括最终会被输出的字符串helloworld\n 第三步 一旦目标文件 hello 中的代码和数据被加载到主存处理器就开始执行 hello 程序的 main 程序中的机器语言指令这些指令将 helloworld\n 字符串中的字节从主存复制到寄存器文件再从寄存器文件中复制到显示设备最终显示在屏幕上
http://www.pierceye.com/news/192143/

相关文章:

  • 电商网站公司软件开发和软件研发
  • 网站建设浙江公司网站开发运营新人要注意什么
  • 外贸网站模板哪里下载家里电脑可以做网站服务器吗
  • 长沙门户网站北京设计网站的公司
  • 站长统计平面设计找工作难吗
  • seo建站公司推荐电商平台活动策划方案
  • 建设淘宝客网站.lc和ev手机对比平台
  • vue 做企业网站特产网站开发背景
  • 奉新网站制作dede视频网站源码
  • 做动画网站去哪采集建设网站需要的资金清单
  • 网站后台发邮件注册公司需要什么证件和手续
  • 炫酷特效网站万网虚拟主机免费空间
  • 公司网站模板最新怀远网站建设哪家好
  • 交互式网站定义如何网上找加工订单
  • 一个域名可以做几个网站吗南城网站建设公司
  • 宝安商城网站建设flash新手入门简单动画制作
  • 设置网站建设WordPress adsen
  • 网站与微信内容建设与运维总结建筑网络图
  • 网站模板文件不存在网站建设礻金手指下拉十二
  • 东莞浩智建设网站公司做百度推广员赚钱吗
  • qq网站推广代码昆明哪里做网站
  • 章丘营销型网站设计公司青岛网络优化排名
  • 制作网站模板的发展空间wordpress 阿里云 cdn
  • 交互式网站备案万网域名网站建设
  • 备案 个人网站名称月坛网站建设公司
  • 网站建设要解决哪些方面的事项临海外发加工网
  • 甜品店网站开发背景江宁区住房建设局网站
  • asp.net网站开发视频教程找能做网站的
  • 租房合同范本下载word东莞网络优化
  • 做网站需要会写代码6net快速建站