Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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('', Split("""stuff.cxx

    And upon running get an error:
    scons: *** Source file: mylib/libMine.a is static and is not compatible with shared target:

    However, I know that a shared library can be made from the .a via command like.

    g++ -m32 -shared -o stuff.o mylib/libMine.a

    Any ideas on getting this to work are doing the run around the issue would be greatly appreciated.


  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts