Linux ---gcc

c语言的链接类型:

动态链接:

ll /lib64/libc-2.17.so

静态链接:

ll /lib64/libc.a

glibc-static安装-CSDN博客icon-default.png?t=N7T8https://blog.csdn.net/itas109/article/details/104226783在Linux中下载c语言的静态库。

gcc test.c -o test.s -static

以静态链接的形式对程序进行编译。

g++ mytest.cpp -o mytest

动态编译c++

Linux 中 g++: command not found 解决方法-CSDN博客icon-default.png?t=N7T8https://blog.csdn.net/TheWindRisesll/article/details/86373940

file mytest

查看链接方式。

change time 为属性修改时间

modify 为内容修改时间

属性改变,内容不一定改变。

内容发生改变,往往会引起属性的变化。

access time 一段时间更新一次

stat xxx

查看文件信息

fflush(stdout)

强制刷新输出

\n在Linux中可带表行缓存

回车:回到当前行的最开始

换行:换到下一行

#include<stdio.h>
#include<unistd.h>
int main()
{
    int cnt=10;
    while(cnt)
    {
        printf("%2d\r",cnt);
        fflush(stdout);
        cnt--;
        sleep(1);
    }
    return 0;
}

倒计时小程序

make 

make 是一个命令

@centos mk]$ make
gcc -o mycode mycode.c 

makefile

makefile是一个文件

@centos mk]$ cat makefile
mycode:mycode.c
        gcc -o mycode mycode.c 

目标文件:依赖列表

第二行必须以tab建开头

.PHONY表示clean是一个伪目标,该目标总是被执行的。

touch mycode.c

可以更新当前文件的时间。

默认makefile指形成一个可执行目标文件。后续不执行。

复杂化后其相当于栈

相关推荐

  1. Linux——gcc

    2024-07-13 02:24:03       29 阅读
  2. GCC 安装编译linux

    2024-07-13 02:24:03       61 阅读
  3. LinuxGCC编译器(七)

    2024-07-13 02:24:03       34 阅读
  4. LinuxGCC&GDB

    2024-07-13 02:24:03       31 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-13 02:24:03       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-13 02:24:03       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-13 02:24:03       58 阅读
  4. Python语言-面向对象

    2024-07-13 02:24:03       69 阅读

热门阅读

  1. 【C++精华铺】13.STL stack 和 STL queue 模拟实现

    2024-07-13 02:24:03       21 阅读
  2. MySQL8之mysql-community-server的作用

    2024-07-13 02:24:03       19 阅读
  3. 十大网站助力人工智能学习之路

    2024-07-13 02:24:03       20 阅读
  4. 【SpringBoot】随机盐值+双重SHA256加密实战

    2024-07-13 02:24:03       20 阅读
  5. 【字符串】tire树 kmp

    2024-07-13 02:24:03       21 阅读
  6. 【TVM 教程】使用 TVM 部署框架预量化模型

    2024-07-13 02:24:03       20 阅读
  7. RabbitMq,通过prefetchCount限制消费并发数

    2024-07-13 02:24:03       20 阅读
  8. C#中的泛型

    2024-07-13 02:24:03       18 阅读