Library extension .a/.so

billt-lxSQFCZeNF4 at public.gmane.org billt-lxSQFCZeNF4 at public.gmane.org
Tue Apr 26 22:47:58 UTC 2005


On Wed, Apr 27, 2005 at 01:35:49AM +0300, Peter wrote:
> 
> >>>> What is the difference in libraries ending with extension .a and .so.
> >>>> Can one convert  from somelib.a to somelib.so?
> 
> To convert .a to .so one must extract the contents of the .a archive 
> using ar and then relink these files into a .so object. Usually it is 
> necessary to also link the .so object against one of the ld.so stubs 
> (usually /lib/ld-linux.so.2) to make it work. This usually works 
> smoothly and solves the problem (static linking) mentioned by Lennart. 
> The exact options to be used vary but the .so name must be linked with 
> general options like:
> 
The important caveat to remember is this works on linux using the gcc compiler because gcc creates relocatable code. Other UNIX or other compiles may not work.

Bill
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list