什么是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文件。
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

希望这有助于。