Thread: including a static library!

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    4

    including a static library!

    I am on Linux Ubuntu x86, and i want to include a ".a" (archive) file (also a static library) to create a ".so" (Shared Object). I have all the includes etc. But i want to include the static library before i compile my files into a shared object. Does someone know how i can do it?

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by hmd View Post
    I am on Linux Ubuntu x86, and i want to include a ".a" (archive) file (also a static library) to create a ".so" (Shared Object). I have all the includes etc. But i want to include the static library before i compile my files into a shared object. Does someone know how i can do it?
    Just list the .a file on the link line, as if it was a .o file. The linker will roll it in. Beware that code which has not specifically been compiled for dynamic linking, may not work properly when converted to a shared object.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. seg fault at vectornew
    By tytelizgal in forum C Programming
    Replies: 2
    Last Post: 10-25-2008, 01:22 PM
  2. LNK2001 ERROR!!! need help
    By lifeafterdeath in forum C++ Programming
    Replies: 7
    Last Post: 05-27-2008, 05:05 PM
  3. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 09:42 PM
  4. Replies: 4
    Last Post: 07-06-2006, 02:53 AM
  5. Making Static Library Files
    By fh791 in forum C++ Programming
    Replies: 2
    Last Post: 09-14-2004, 07:06 AM