Results 1 to 2 of 2
I'm trying to get SCons to make a shared library. One of the items going into the .so is a .a static lib.
I have a line like:
env_2.SharedLibrary('libstuff.so', Split("""stuff.cxx
...
- 02-11-2010 #1Just Joined!
- Join Date
- Dec 2006
- Posts
- 2
SCons to make .so with .a
I'm trying to get SCons to make a shared library. One of the items going into the .so is a .a static lib.
I have a line like:
env_2.SharedLibrary('libstuff.so', Split("""stuff.cxx
mylib/libMine.a""")
And upon running get an error:
scons: *** Source file: mylib/libMine.a is static and is not compatible with shared target: libstuff.so
However, I know that a shared library can be made from the .a via command like.
g++ -m32 -shared -o libstuff.so stuff.o mylib/libMine.a
Any ideas on getting this to work are doing the run around the issue would be greatly appreciated.
-jk
- 02-12-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,943
First, all the objects in the static library have to be compiled with the PIC (position indepent code) option. Next, you probably need to extract all the .o files from the archive in order to link them into a shared library.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
