最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
centos系统make install 安装程序包案例
时间:2022-06-30 20:46:39 编辑:袖梨 来源:一聚教程网
准备写好的c文件
1、ws.h 【头文件,声明函数名,未实现】
2、wso.c【包含函数体,实现函数,需要编译成动态链接库】
3、ws.h 【主程序执行文件】
新建makefile文件
toucu makefile 建立makefile文件
vi makefile 编辑makefile,
在makefile编写make命令可执行的code
newws:ws.c libme.so
gcc -L ./ -l me ws.c -o newws
libme.so:ws.c
gcc -shared wso.c -o libme.so
install:
cp ./libme.so /lib64
ldconfig
命令解析: 1、 makefile格式 最终生成的文件 newws 依赖于 shenyi.c libme.so 2、gcc生成编译文件命令 -L ./ 当前目录 -l mewso.c 生成最终newws 3、 libme.so 依赖于 ws.c 4、生成编译文件.so的命令(ws.c变成成libme.so) 5、make install 安装
5.1、将编译文件拷入核心库
5.2、更新缓存
相关文章
- 土豆视频网页版入口-土豆视频高清在线播放 12-01
- Hitomi.la最新镜像网站入口 - 2026可用国内访问地址分享 11-26
- 土豆视频网页版入口地址-土豆视频在线播放入口 11-17
- 哔哩哔哩官方网页版入口地址-哔哩哔哩blibili手机电脑网页版入口地址 11-16
- AO3镜像网站最新入口汇总 - 2026可用镜像链接列表 11-16
- 超星学生通登录入口-超星官网网页版登录入口 11-13