including a static library!

This is a discussion on including a static library! within the C Programming forums, part of the General Programming Boards category; I am on Linux Ubuntu x86, and i want to include a ".a" (archive) file (also a static library) to ...

  1. #1
    hmd
    hmd is offline
    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
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,270
    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, 02:22 PM
  2. LNK2001 ERROR!!! need help
    By lifeafterdeath in forum C++ Programming
    Replies: 7
    Last Post: 05-27-2008, 06:05 PM
  3. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 10:42 PM
  4. Replies: 4
    Last Post: 07-06-2006, 03:53 AM
  5. Making Static Library Files
    By fh791 in forum C++ Programming
    Replies: 2
    Last Post: 09-14-2004, 08:06 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21