当前位置:首页>Linux>OS12.【Linux】gcc和g++以及动静态链接

OS12.【Linux】gcc和g++以及动静态链接

  • 2026-06-30 14:43:29
OS12.【Linux】gcc和g++以及动静态链接

目录

1.知识回顾

总结

2.gcc和g++的简单区别

3.知识点

gcc或g++默认搜索头文件的路径

命令

预处理(-E选项,全称prEprocess only)

编译(-S选项,全称Stop after the stage of compilation proper)

汇编

生成Intel格式的汇编代码文件

链接

-std

优化选项(-O0~-O3)

 -Wall和-Werror

-g

readelf命令

-D

库的概念

定义

分类

后缀名

动态链接

为什么动态链接库可以隐藏源代码?

ldd命令

静态链接

补充资料: 《程序是怎样跑起来的 第3版》 第8章 从源文件到可执行文件

gcc的-static选项

常见问题

file命令

两类库的优缺点

4.安装最新版的gcc-13

★5.stackoverflow中关于链接过程的高赞回答


1.知识回顾

预处理、编译、汇编和链接过程的复习:

90.【C语言】编译和链接

93.【C语言】解析预处理(1)

94.【C语言】解析预处理(2)

95.【C语言】解析预处理(3)

96.【C语言】解析预处理(4)

总结

1.预处理功能主要包括宏定义,文件包含,条件编译,去注释等

2.编译功能主要是生成汇编代码

3.汇编功能主要是从汇编代码生成机器码

4.链接功能主要是生成可执行文件或库文件

2.gcc和g++的简单区别

暂且认为gcc只能编译C语言,g++能编译C/C++

3.知识点

gcc或g++默认搜索头文件的路径

在/usr/include的路径下搜索

命令

这里只讲gcc的命令,g++也是类似的

预处理(-E选项,全称prEprocess only)

-E只执行预处理 

例如有一个test.c文件,

#includeintmain(){    printf("Hello World!\n");    return 0;}

要求生成预处理后的文件,使用以下命令

gcc -E test.c -o test.i

解释参数: -E的作用:只进行预处理操作,注意:-E选项紧跟着要预处理的文件,-o选项紧跟着要生成的文件

 有了上面的解释,反过来写也是可以的:

gcc -o test.i -E test.c 

运行结果:

编译(-S选项,全称Stop after the stage of compilation proper)

要求对test.i文件生成编译后的文件,使用以下命令(其实-S选项严格来说是执行预处理、编译这两个过程)

gcc -S test.i -o test.s

注意:-S选项紧跟着要编译的文件,-o选项紧跟着要生成的文件

运行结果:

汇编

如果只是从test.s生成test.o目标文件,这个过程叫"汇编",可以使用-c选项执行(其实-c选项严格来说是执行预处理、编译、汇编这三个过程,-c的全称complie only,只编译,不链接)

(注:英文的complie指的是预处理、编译和链接三个过程,不单单指字面意义上的编译

(来自https://embeddedprep.com/gcc-command-line-options/网站) 

gcc -c test.s -o test.o

生成的test.o被称为可重定位的目标二进制文件,简称目标文件(在Windows平台下是*.obj文件)

注意:目标文件不可单独执行,需要经过链接才可以

运行结果:

因为生成的是二进制代码,所以vim打开是乱码

生成Intel格式的汇编代码文件

添加这个选项:

-masm=intel

如果想去除汇编代码文件中额外的伪指令,可以添加这些选项:

-fno-asynchronous-unwind-tables \-fno-dwarf2-cfi-asm \-fno-exceptions \-fno-pic \-fno-pie

链接

可重定位的目标二进制文件和库链接在一起形成可执行文件

如果只是从test.o生成test.out可执行文件,不用带其他选项,直接-o即可

gcc test.o -o test.out #生成的可执行文件是test.out

注:如果想从源文件直接得到可执行文件,可以直接使用此命令:gcc test.c -o test.out

,如果不提供可执行文件的名称,gcc/g++自动讲可执行文件起名为a.out(全称assembler output)

(不建议写成gcc -o test.out test.c,-o后面紧跟的是生成的文件)

运行结果:

-std

例如-std=c++11

有些情况下,需要加入C/C++标准的选项,例如以下代码:

#include#includeusing namespace std;intmain(){    vector v={1,2,3};    for (auto a:v)    {        cout<

如果不用-std=c++11会报错:

因为范围for是C++11标准引入的(在CC7.【C++ Cont】范围for的使用和auto关键字文章讲过),所以要加-std=c++11,运行结果如下:

优化选项(-O0~-O3)

 合理使用优化选项能提高程序的性能,例如以下代码,放到https://godbolt.org/网站上测试,编译器旋转x86_64 gcc 11.4

intfunc() {    for (int i=0;i<=5;)//这个循环是没有用的        i++;    printf("teststring");    return 0;}

O0优化结果:

O1优化结果:

开O1优化把没有用的循环优化掉了,如下反汇编代码:

 -Wall和-Werror

 -Wall允许大多数编译器的警告(Enable most compiler warnings)

-Werror让编译器把警告当成错误处理

例如以下代码使用了未定义的变量,如果不加这两个选项,gcc不会报警告

#includeintmain(){    int a;    printf("%d",2);    return 0;}

运行结果: 

 如果加了 -Wall和-Werror:

 如果只加了 -Wall:

-g

作用:包含调试信息到目标文件或可执行文件中,一般调试时这两个选项经常在一起使用: -g -O0

gcc test.c -g -O0 -o test-debug.out

readelf命令

显示ELF(Executable and Linkable Format,可执行和可链接格式)文件的头信息、程序头表、节头表、符号表、重定位表等详细信息

对上述生成的test-debug.out使用readlyelf命令

readelf -S test-debug.out | grep "debug"

可以截取到带"debug"字样的信息 

-D

作用:在命令中添加宏定义,这个在调试中非常有用

例如以下代码:

#includeintmain(){    #ifdef __DEBUG__        printf("Debug mode\n");    #else	 printf("Release mode\n");    #endif        printf("Hello World!\n");    return 0;}

(有关#ifdef和#endif的介绍参见96.【C语言】解析预处理(4)文章) 

如果执行gcc test.c命令:

如果执行gcc test.c -D__DEBUG__命令:

库的概念

1.编译型语言安装开发包时,必定是下载安装对应的头文件和库文件

2.链接过程和库有关,库文件提供了方法的实现,常见的库有C语言标准库

定义

库其实就是把经过一定的翻译后的源文件进行打包,最终只提供一个文件,不用提供太多的源文件,简单来说可执行文件=代码+库文件(方法实现)+头文件(方法声明),也可以达到隐藏源文件的目的

分类

后缀名

动态库

Linux下的*.so(全称shared object),Windows下的*.dll(全称dynamic link library)

静态库

Linux下的*.a(全称static library),WIndows下的*.lib(全称static library)

Linux下动态链接库文件的存放位置:/lib64/libc*

可以看出文件名有一定的规律,以lib开头,中间是名称,结尾是so和版本号,例如:

*注:一般云服务器上的安装好的Linux系统默认只有动态库,不带静态库,如果需要那就要手动安装

动态链接

动态链接:程序运行时加载和链接库文件,换而言之,动态库是依附于可执行文件创建的进程来执行的,可执行文件自己不带动态链接库,需要到系统中调用动态链接库,完成后返回代码的调用处

可以得出以下结论:

动态库不能缺失! 一旦对应的动态库缺失,影响的不止一个程序,可能导致很多程序都无法进行正常运行

比如Linux下的命令依赖很多动态库

为什么动态链接库可以隐藏源代码?

由上述所说: 调用者只需要根据自己要实现的功能调用动态链接库中对应的接口,而不需要知道每个接口函数具体的实现,则对于动态链接库的设计者而言,隐藏了接口的代码实现

ldd命令

作用:查看程序依赖的动态链接库

例如对于一个简单的Hello World程序,查看其动态链接库:

静态链接

和动态链接不同,编译器使用静态库进行静态链接时,会将自己方法拷贝到目标程序中,程序在调用静态链接库的方法时不会转到系统中的动态链接库中执行

安装静态链接库的命令:

sudo yum install -y glibc-static libstdc++-static #C++静态库和C语言静态库

 Linux下动态链接库文件的存放位置:/lib64/lib*.a

显然静态链接只能使用静态库,动态链接只能使用动态库

补充资料: 《程序是怎样跑起来的 第3版》 第8章 从源文件到可执行文件

该章的后半部分内容简单提到了动态库和静态库,这里简单摘录一下:

8.6 DLL 文件与导入库  Windows 操作系统中包含可供应用程序使用的各种功能,这些功能都是以函数的形式来提供的,这样的函数称为 Windows API(Application Programming Interface,应用程序接口)。例如,sample.c 中调用的 MessageBox() 并不是 C 语言规范中的标准函数,而是 Windows 提供的 API 的一部分。MessageBox() 函数提供了显示消息框的功能。

Windows API 的目标文件通常不是以库文件的形式存在的,而是以一种称为 DLL(动态链接库)的特殊库文件的形式存在的。正如其名称中的“动态”一词所表示的那样,DLL 文件是在程序运行时才进行链接的。之前讲过,MessageBox() 的目标文件位于 import32.lib 中,但实际上 import32.lib 中只包含 MessageBox() 位于 DLL 文件 user32.dll 中这一信息,以及这个 DLL 文件所在的目录,并不包含 MessageBox() 的目标文件本身。像 import32.lib 这样的库文件称为导入库。

与之相对,包含目标文件本身,可以直接链接到 EXE 文件的库文件称为静态链接库(static link library),其中“静态”与“动态”是一对反义词。sprintf() 的目标文件所在的 cw32.lib 就属于静态链接库。sprintf() 函数提供了将数值按指定格式转换成字符串的功能。

将导入库链接到 EXE 文件,就相当于链接了运行时从 DLL 文件中调用 MessageBox() 函数所需的信息。因此,链接器在链接时不会报错,成功生成了 EXE 文件。

gcc的-static选项

-static作用:编译时所有的库强制使用静态链接库

对于一个简单的Hello World程序,编译时分别使用动态和静态链接库:

gcc test.c -o test-static.out -staticgcc test.c -o test-dynamic.out

会发现用静态链接库生成的可执行文件体积比动态链接库的要大很多,因为进行静态链接编译器会将自己方法拷贝到目标程序中,因此开发中静态库很少使用

常见问题

1.无静态库能否使用-static选项?

显然不能

2.无动态库只有静态库,而且gcc命令没有-static选项,使用什么库?

显然是静态库,得出结论:gcc默认优先动态链接,-static的本质:改变链接的优先级

3.动静态链接可以是混合的,不一定只有一种,但-static选项是强制所有链接变成静态链接

file命令

作用:分析文件的内容来判断文件类型,而不是仅仅依靠文件扩展名

当然也可以看是动态链接还是静态链接

两类库的优缺点

1.动态库

动态库是共享库,因此节省资源(磁盘空间、内存空间和网络空间等),但是系统的动态库如果丢失,会导致很多程序无法运行

2.静态库

程序不依赖系统提供的动态库,可以独立运行,但体积大,会消耗较多资源

节省内存空间的原因:程序运行时要加载到内存,节省内存资源

节省网络空间的原因:省下载的流量

4.安装最新版的gcc-13

sudo apt updatesudo apt install software-properties-common -ysudo add-apt-repository ppa:ubuntu-toolchain-r/test -ysudo apt updatesudo apt install gcc-13 g++-13 -ygcc-13 --versiong++-13 --version

★5.stackoverflow中关于链接过程的高赞回答

c++ - Why use #ifndef CLASS_H and #define CLASS_H in .h file but not in .cpp? - Stack Overflow

Justin Summerlin:

In C++ programming as a general practice we separate development into two file types. One is with an extension of .h and we call this a "header file." They usually provide a declaration of functions, classes, structs, global variables, typedefs, preprocessing macros and definitions, etc. Basically, they just provide you with information about your code. Then we have the .cpp extension which we call a "code file." This will provide definitions for those functions, class members, any struct members that need definitions, global variables, etc. So the .h file declares code, and the .cpp file implements that declaration. For this reason, we generally during compilation compile each .cpp file into an object and then link those objects (because you almost never see one .cpp file include another .cpp file).

How these externals are resolved is a job for the linker. When your compiler processes main.cpp, it gets declarations for the code in class.cpp by including class.h. It only needs to know what these functions or variables look like (which is what a declaration gives you). So it compiles your main.cpp file into some object file (call it main.obj). Similarly, class.cpp is compiled into a class.obj file. To produce the final executable, a linker is invoked to link those two object files together. For any unresolved external variables or functions, the compiler will place a stub where the access happens. The linker will then take this stub and look for the code or variable in another listed object file, and if it's found, it combines the code from the two object files into an output file and replaces the stub with the final location of the function or variable. This way, your code in main.cpp can call functions and use variables in class.cpp IF AND ONLY IF THEY ARE DECLARED IN class.h.

原文首发于CSDN,点击阅读全文即可查看

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 16:51:56 HTTP/2.0 GET : https://f.mffb.com.cn/a/494288.html
  2. 运行时间 : 0.121872s [ 吞吐率:8.21req/s ] 内存消耗:4,753.25kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=980454a8c6a7bc2f49367d9f5b964c57
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000711s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000759s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.003215s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000285s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000501s ]
  6. SELECT * FROM `set` [ RunTime:0.000207s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000562s ]
  8. SELECT * FROM `article` WHERE `id` = 494288 LIMIT 1 [ RunTime:0.000696s ]
  9. UPDATE `article` SET `lasttime` = 1783068716 WHERE `id` = 494288 [ RunTime:0.000756s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.000247s ]
  11. SELECT * FROM `article` WHERE `id` < 494288 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000470s ]
  12. SELECT * FROM `article` WHERE `id` > 494288 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000428s ]
  13. SELECT * FROM `article` WHERE `id` < 494288 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.012430s ]
  14. SELECT * FROM `article` WHERE `id` < 494288 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.005585s ]
  15. SELECT * FROM `article` WHERE `id` < 494288 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.026440s ]
0.123428s