The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shared memory in shared library DreamWarrior High Level Programming 12 05-30-2007 01:33 PM
how to view loaded shared libraries by running processes in linux princelinux High Level Programming 3 01-17-2007 03:44 AM
Listing the contents of a shared Unix library mickpoil UNIX for Dummies Questions & Answers 1 10-05-2006 03:26 AM
view libraries and contents of object files and shared library naren_chella HP-UX 4 06-22-2006 07:12 AM
Unable to view contents of a directory maddave UNIX for Dummies Questions & Answers 13 10-24-2001 10:50 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-25-2006
Registered User
 

Join Date: Feb 2006
Posts: 35
Stumble this Post!
view contents of shared library

Hi ,

i have two doubts in Hp-Ux

1) How to View objects or contents in a shared library in HP-Ux
2) Can i added a c object file to the existing shared file from a different directory .
for example :

I have two directories X and Y

I have a.o b.o c.o object files in X directory

I create a shared library
ld -b -o libx.sl a.o b.o c.o

I Have d.o in Y directory now i want to add d.o to shared libx.sl created in X directory .

ld -b -o libxl.o ../d.o ( will t


Many thanks
Narendra
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-25-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,795
Stumble this Post!
1. use nm <sharedlibrary> | more
2. Assuming I understand what you're saying - You need to compile your module then relink the whole shared library. Which means you need all of the source or objects used to make that library to start with. You cannot just add an object.
Reply With Quote
  #3 (permalink)  
Old 05-25-2006
Registered User
 

Join Date: Feb 2006
Posts: 35
Stumble this Post!
shraed library

Hi Jim ,

Thanks for your updates Jim 1st one worked fine .

I got some info reg the 2nd one .
to be more clear
My question was whether i need to have all the source files in one place ( in same directory) and compile in same directory also having all the object files in the same directory and make a shared lib in the same directory .

in simple statement do i need to have all the c source files ,object files e and create a shared lib from object files in the same directory .


Does that mean i cannot have c source file and its object file in another directory to be added to the exiting shared library present in other directory

or It is must that i have to take the c source file and compile it in the directory where the shared librray is created with the rest of files


Ofcourse i will once again add all the .o files into shared lib when it is newly created or when a new object is created


Soory for the lengthy explanation

if anything else let me know


Many Thanks
naren
Reply With Quote
  #4 (permalink)  
Old 05-26-2006
Registered User
 

Join Date: May 2006
Posts: 12
Stumble this Post!
You can keep all the *.o in one directory & create the shared library.
No need to keep the source in that dir.
Reply With Quote
  #5 (permalink)  
Old 05-26-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,795
Stumble this Post!
In fact, if you want to keep things neat, you can use ar to create a single file with most (or All) of your object files. ar will let you update existing objects, or add new ones.

try man ar
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:35 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0