什么是u和.so文件? [英] What are .a and .so files?

查看:277
本文介绍了什么是u和.so文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在试图端口C应用到AIX和我越来越糊涂了。什么是.A和.so文件,以及如何构建/运行应用程序时使用它们?

I'm currently trying to port a c application to AIX and am getting confused. What are .a and .so files and how are they used when building/running an application?

推荐答案

归档库(.a)中静态链接即。所以,如果有一个在库中的任何变化,你需要编译并重新建立你的code。

Archive libraries (.a) are statically linked i.e when you compile your program with -c option in gcc. So, if there's any change in library, you need to compile and build your code again.

的.so(共享对象)的过。一个库的好处是,他们是在创造您的GCC文件的.o -o选项后,在运行时,即链接。所以,如果有一个在.so文件发生任何变化,你不需要重新编译主程序。
但要确保你的主程序链接到新的.so文件与ln命令。

The advantage of .so (shared object) over .a library is that they are linked during the runtime i.e. after creation of your .o file -o option in gcc. So, if there's any change in .so file, you don't need to recompile your main program. But make sure that your main program is linked to the new .so file with ln command.

这将帮助你建立.so文件。
<一href=\"http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html\">http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html

This will help you to build the .so files. http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html

希望这有助于。

这篇关于什么是u和.so文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆