首页 > 代码库 > UNIX下C语言编程静态库的生成
UNIX下C语言编程静态库的生成
1.设计库源码
pr1.c
1 void print1()2 {3 printf("This is the first lib src \n");4 }
pr2.c
1 void print2()2 {3 printf("This is the second lib src \n");4 }
2.编绎.o文件
gcc -O -c pr1.c pr2.c
3.链接静态库
ar -rsv libpr.a pr1.o pr2.o
UNIX下C语言编程静态库的生成
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。