Can a static library be compiled into a shared library?

Can a static library be compiled into a shared library?

Post by car.. » Thu, 16 Sep 1999 04:00:00


Here at work we're attempting to make a .so file out of some .o files
and some previously existing .a files. Right now that's not working at
all. As a metter of interest, the code is C++ with templates, and must
be linked with the ObjectSpace Standards<Toolkit> library. A question:

Is the PIC option necessary for everything that goes into an .so?

Compiler: Sun Workshop 3.0 CC
System: SunOS 5.5.1 (Which Solaris is that anyway?)

Steve Carrow

Sent via
Share what you know. Learn what you don't.


1. Compiling static libraries as shared libraries

Howdy! I've got myself ~50 megs of sources for about 10 meg of libraries I've
been working with. Right now, they all compile nicely and give me some nice
libwhatever.a files. OK, that's swell, but I can't statically link a good
portion of my programs (Damn ELF won't compile them statically :), so I need to
compile them as So, how do I change my source for this. Right
now I'm doing this.

ls -r -o libwhatever.a object1.o object2.o object3.o object4.o

Any help is appreciated.

Justin (Gus) Hurwitz

2. No ISDN Traffic when accesing a IDE drive

3. Building shared library which includes static libraries

4. Redirection of stderr to a variable?

5. Converting a Static Library to a Shared Library

6. mouse prog thro curses ?

7. Building shared libraries that contain static libraries.

8. Device driver cleanup

9. Using static libraries and shared libraries in same program?

10. Using libtool to build shared libraries that depend on static libraries

11. link static libraries into a shared library

12. libtool and shared libraries with static library references

13. how do I find out what shared libraries and static libraries a program depends on?