How to create shared libray in UNIX


 
Thread Tools Search this Thread
Top Forums Programming How to create shared libray in UNIX
# 1  
Old 01-25-2008
Power How to create shared libray in UNIX

Hello Experts,

I want to know, how to create a shared libs (.so file) in Linux/UNIX ,
If i ve files like below

1. adc_mdl.cc----2. adc_mdl.h
3. agc_mdl.cc----4. agc_mdl.h
5. ue_mdl.cc----- 6. ue_mdl.h
7. dcc_mdl.cc---- 8. dcc_mdl.h
9. ue_afe_mdl.cc-10. ue_age_mdl.h
11.ue_rf_mdl.cc---12. ue_rf_mdl.h

Please help me with code or I need to make a MAKEFILE to do that.
# 2  
Old 01-25-2008
# 3  
Old 01-25-2008
Quote:
Originally Posted by vino
Thanks for the links .

I ll go through that..
# 4  
Old 01-28-2008
Quote:
Originally Posted by vino
Dear Vino,

I tried with these two commands to create shared library..

1.gcc -fPIC -g -c -Wall hello.c
2. gcc -shared -Wl,-soname,libmystuff.so.1 -o libmystuff.so.1.0.1 hello.o -lc

But when I am trying the second command It is showing the following errors.

ld: warning: option -o appears more than once, first setting taken
ld: fatal: file libmystuff.so.1: open failed: No such file or directory
ld: fatal: File processing errors. No output written to libmystuff.so.1.0.1
collect2: ld returned 1 exit status

I am using UNIX.


Please need help ......

user_prady

Last edited by user_prady; 01-28-2008 at 02:17 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Create shared libs on AIX (with certain libs which are statically linked)

I want to create a shared lib with certain libs statically linked to it. I can generate a fully shared lib as follows: gcc -maix64 -DHAVE_CONFIG_H -I. -I./src -DHAVE_OPENSSL -I/usr/include/openssl -I/usr/include -I/usr/include/apr-1 -D_LARGEFILE64_SOURCE -I/usr/java8_64/include -shared -o... (0 Replies)
Discussion started by: amandeepgautam
0 Replies

2. Shell Programming and Scripting

Create a shared folder using acl

Hello. I need some help to create a shared folder. A group 'publicuser' has been created. A user 'publicuser' has been created ( no login, no home) and belongs to group 'publicuser'. A public folder '/doc' has been created and owner is publicuser:publicuser. All users belonging to group... (12 Replies)
Discussion started by: jcdole
12 Replies

3. Shell Programming and Scripting

Copy file from UNIX to shared location

Hi All, I want to transfer file from UNIX to shared locataion . Shared location doesn't resides on my system. Can somebody tell me is there any way i can transfer file from UNIX to shared location without using any tool WINSCP. Thanks, Amit (1 Reply)
Discussion started by: Amit786
1 Replies

4. Programming

What Unix do with unused shared memory?

Hello, When creating shared memory in C, should be remove shared memory with shmctl function when don't need it. If it didn't remove, occupied shared memory stay and remain. If we create shared memory repeatedly without removing unusable shared memory, /dev/shm will full. Does Unix or... (1 Reply)
Discussion started by: pronetin
1 Replies

5. Programming

Can I create a shared object by using an static lib?

for example, I have a static lib name liba.a it offers some interface such a1();a2(); but i do not have the source code of liba.a; If i would like to create a shared object, and offer the similar interface of a1 and a2; Is there a way to fulfill such requirement? thanks. (7 Replies)
Discussion started by: flost
7 Replies

6. Filesystems, Disks and Memory

Shared Home directory between Unix servers

Hi Im working in an environment where 2 production and 2 testing unix servers are used.. All these servers share the same home directory.. how is it done where would the home directory be located (0 Replies)
Discussion started by: raghav288
0 Replies

7. Programming

debugging a shared library (unix)

How can I debug a C++ program (unix) that uses a dinamycaly linked library (dlopen(), dlsym())? I mean I want to be able to go through the library code too. I used ddd, but it's not working. thanks in advance! nadia (2 Replies)
Discussion started by: nadiamihu
2 Replies

8. UNIX for Dummies Questions & Answers

Listing the contents of a shared Unix library

I am brand new to Unix. This is probably simple, but how do you list the contents of a shared library? I need to see which functions exist in it. Many thanks. (1 Reply)
Discussion started by: mickpoil
1 Replies

9. Filesystems, Disks and Memory

Unix Sco Open Server, Windows Computers Problem Access Unix Shared Files Help!!!!!

Hello Moto I hope someone can help We's here at work, have a unix box with sco openserver 5 on it, so it has a nice gui interface.. and also a fair few windows computers.. a system admin guy b4 me, has set up a user called neil, which can, when u try to access the unix box using windows... (2 Replies)
Discussion started by: haggo
2 Replies

10. SCO

Clear / Remove / Create Shared Memory...

Hi all... am not so much brilliant in this area... here i think many good hearted peoples around... so if anybody have intention to reply for my problem please give me a cut and clear picture of how... Thanks. ok comming to my problem... In our MHC server (Sco Unix 4.*) running 19 C process... (1 Reply)
Discussion started by: yocks
1 Replies
Login or Register to Ask a Question