Thread: How to add object modules in an existing shared library in Linux

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    23

    How to add object modules in an existing shared library in Linux

    Hi,

    I have an libf.so in which i want to add a .o file say function.o without deleting the library and then again creating it.I just want to add function.o in libf.so.Help expected.....

    Regards,
    Arka

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Look up the "ar" command.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  3. #3
    Registered User
    Join Date
    Aug 2011
    Posts
    23
    Hi,

    Thanks for your reply.But ar will work with .a static libs.I tried it with .so shared objects.It didn't work.

  4. #4
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Ah, sorry. I'm a little tired. .so files are produced with the linker (or with the compiler driver and appropriate options). AFAIK, they need to be built from .o files, and cannot be added to incrementally.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Undefined Reference to Existing Library
    By SparkT in forum C Programming
    Replies: 3
    Last Post: 10-30-2009, 03:48 PM
  2. problem in changing shared library path in linux
    By remyasj in forum Linux Programming
    Replies: 3
    Last Post: 08-06-2009, 08:31 AM
  3. Linux Security Modules Programming
    By vugluskr in forum Linux Programming
    Replies: 1
    Last Post: 02-17-2009, 11:10 AM
  4. Porting a shared library from Linux to Windows
    By DARKGuy in forum C++ Programming
    Replies: 1
    Last Post: 06-23-2007, 01:45 PM
  5. Difference between library, modules and packages
    By ripper079 in forum C++ Programming
    Replies: 1
    Last Post: 03-19-2003, 05:29 AM