.so和.a文件有什么区别? [英] what is the difference between .so and .a files?
问题描述
我正在尝试编译第3方库(在linux上),并看到它正在生成libsomething.a文件,而我的其他库也是.so文件
I am trying to compile a 3rd party library( on linux) and see that it is generating libsomething.a files I have my other libraries which are .so file
但是看起来.a甚至是共享库,可以像.so lib一样使用
But it appears that even .a is shared library and can be used just like a .so lib
那么两者之间有什么区别吗?或它们只是具有相同的命名约定而已.
So is there any difference between the two ? or they are just same with different naming convention.
推荐答案
但是似乎.a还是共享库
But it appears that even .a is shared library
不是,这是一个静态库.
Nope, it's a static library.
,可以像.so lib
and can be used just like a .so lib
如果您打算链接到它,那么可以.但是您不能dlopen()一个.a文件,而该文件可以使用.so文件来完成.
If you mean linking to it, then yes. But you can't dlopen() an .a file which you could do with an .so file.
您总是可以要求我们的老朋友 G叔叔回答您的问题
You can always ask our old friend Uncle G to answer your questions.
这篇关于.so和.a文件有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!