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
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.
But it appears that even .a is shared library
Nope, it's a static library.
and can be used just like a .so lib
If you mean linking to it, then yes. But you can't dlopen() an .a file which you could do with an .so file.
You can always ask our old friend Uncle G to answer your questions.
A .a file is a static library, while a .so file is a shared object dynamic library similar to a DLL on Windows.
A .a can included as part of a program during the compilation & .so can imported, while a program loads.
When you link against the *.a, the code from the library is included in the executable itself and the executable can be run without requiring the *.a file to be present. When you link against the *.so, that is not the case and the *.so file must be present at runtime.
来源:https://stackoverflow.com/questions/12293530/what-is-the-difference-between-so-and-a-files