Summary: Archive to shared-lib?

From: <doug.otto_at_npawest.com>
Date: Thu Jul 19 2001 - 16:11:14 EDT
I got input from several folks ranging from "you can't do it" to "you
should be able to do it" and several "if you figure out how to do this
let me knows" so I kept hammering on it. 

Both John Fieber and Ronald Loftin indicated that the object files in my
archive must have been built as relocatable or you can't build a shared
lib from them.  In my case they were.


Here's what I ended up doing:

cp libwhatever.a.2.10.0 /tmp
cd /tmp
ar -x libwhatever.a.2.10.0 # which extracts all the object files form
the archive.  
gcc -G -o libwhatever.so.2.10.0 -h libwhatever.so.2.10.0 *.o

Then copied my output to a directory in my LD_LIBRARY_PATH

Now I get the following:


wallace# file libwhatever.so.2.10.0
libwhatever.so.2.10.0:	ELF 32-bit MSB dynamic lib SPARC Version 1,
dynamically linked, not stripped

... the application is happy and all is well with the world.

Thanks

doug.otto@npawest.com wrote:
> 
> I'm brainfarting here...
> 
> I've got a precompiled app that is choking on not finding a
> shared lib, eg. libwhatever.so.2.0.  I do have, on my system,
> the archive file libwhatever.a.2.0.  For the life of me I
> can't remember how create the shared lib from the archive file.
> 
> Thanks
> 
> --
> Doug Otto
> Sr. Systems Engineer             916.631.8007
> NPA West                doug.otto@npawest.com
> 
> _______________________________________________
> sunmanagers mailing list
> sunmanagers@sunmanagers.org
> http://www.sunmanagers.org/mailman/listinfo/sunmanagers

--
Doug Otto
Sr. Systems Engineer	         916.631.8007
NPA West		doug.otto@npawest.com
Received on Thu Jul 19 21:11:14 2001

This archive was generated by hypermail 2.1.8 : Wed Mar 23 2016 - 16:24:59 EDT