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指形成一个可执行目标文件。后续不执行。

复杂化后其相当于栈

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值