Shared libaries


 
Thread Tools Search this Thread
Operating Systems Linux Shared libaries
# 1  
Old 06-19-2008
Shared libaries

Hi all
i am trying to implement a shared library an my system and follow the following steps
I created two files and created object files
gcc -fPIC -c file1.c
gcc -fPIC -c file2.c

Now when i tried to create a shared library i am receiving different results when i try to use various options that i have seen implemented across various examples of shared libraries.Sometimes it is creating an executable a.out.

I finally managed to create library mystuff.so.1.1 by following command
gcc -shared -WI,-soname,mystuff.so -o mystuff.so.1.1 file1.o file2.o -lc;

but i am receiving both environmental variables LD_LIBRARY_PATH as well as LD_PRELOAD as null.I am logged in on KDE.

I can't understand what is happening in entire procedure

Thanks for any assistance
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

A former shared filesystem which is not available

ggod morning, i need your helo, there is a hp_ux server named XYZ, somebody told me there was a shared network file system which was used for several tasks but now its not avalibale, but he doesnt remain which was the name of the machine which it it had this FS. evnthouh in a file called fstab... (2 Replies)
Discussion started by: alexcol
2 Replies

2. Programming

Shared library with acces to shared memory.

Hello. I am new to this forum and I would like to ask for advice about low level POSIX programming. I have to implement a POSIX compliant C shared library. A file will have some variables and the shared library will have some functions which need those variables. There is one special... (5 Replies)
Discussion started by: iamjag
5 Replies

3. AIX

Shared FS

I am working on project that need shared access to the FS from 2 AIX HACMP nodes. This FS is created on a SAN disk and the VG that includes this FS is active on node A. What options do I have so that this FS can also be accessed from Node B ? We don't have GPFS, so that is not a option.... (3 Replies)
Discussion started by: mk8570
3 Replies

4. Programming

Shared memory for shared library

I am writing a shared library in Linux (but compatible with other UNIXes) and I want to allow multiple instances to share a piece of memory -- 1 byte is enough. What's the "best" way to do this? I want to optimize for speed and portability. Obviously, I'll have to worry about mutual exclusion. (0 Replies)
Discussion started by: otheus
0 Replies

5. UNIX and Linux Applications

Linking Libaries to binary executable

Hello, I am using Open Suse 10.3. I have implemented Zeroconf and the program is working with out any errors. Libray linking for normal executable: gcc -o name name.c -lavahi-client.so (WORKING) Now i have to create a binary executable, to have the program running on a device. For a... (0 Replies)
Discussion started by: bhavana
0 Replies

6. Programming

Shared memory in shared library

I need to create a shared library to access an in memory DB. The DB is not huge, but big enough to make it cumbersome to carry around in every single process using the shared library. Luckily, it is pretty static information, so I don't need to worry much about synchronizing the data between... (12 Replies)
Discussion started by: DreamWarrior
12 Replies

7. Programming

help with shared memory

what i want to do is have an int that can been written into by 2 processes but my code doesn't seem to work. #include <sys/types.h> #include <sys/ipc.h> #include <sys/sem.h> #include <sys/shm.h> #include<stdio.h> #define KEY1 (1492) int main() { int shmid; volatile int * addr;... (6 Replies)
Discussion started by: ddx08
6 Replies

8. UNIX for Advanced & Expert Users

shared library

What is the primary difference between static library and dynamic library? and how to write static shared library? (1 Reply)
Discussion started by: areef4u
1 Replies

9. Programming

Can FD's be shared between threads?

Hello, Can a FD (file desc.) from a pipe(...); call be shared between a thread? / Henrik (2 Replies)
Discussion started by: ne2000
2 Replies

10. Linux

Shared Libraries

How do i make a library shared say i have a library a.so which i have just compiled. I want to make it shared how do i make it Next Queation is what is the difference between a.so.0 a.so.1 a.so.2 & a.so :rolleyes: (1 Reply)
Discussion started by: wojtyla
1 Replies
Login or Register to Ask a Question
comm(1) 							   User Commands							   comm(1)

NAME
comm - select or reject lines common to two files SYNOPSIS
comm [-123] file1 file2 DESCRIPTION
The comm utility reads file1 and file2, which must be ordered in the current collating sequence, and produces three text columns as output: lines only in file1; lines only in file2; and lines in both files. If the input files were ordered according to the collating sequence of the current locale, the lines written will be in the collating sequence of the original lines. If not, the results are unspecified. OPTIONS
The following options are supported: -1 Suppresses the output column of lines unique to file1. -2 Suppresses the output column of lines unique to file2. -3 Suppresses the output column of lines duplicated in file1 and file2. OPERANDS
The following operands are supported: file1 A path name of the first file to be compared. If file1 is -, the standard input is used. file2 A path name of the second file to be compared. If file2 is -, the standard input is used. USAGE
See largefile(5) for the description of the behavior of comm when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). EXAMPLES
Example 1: Printing a list of utilities specified by files If file1, file2, and file3 each contain a sorted list of utilities, the command example% comm -23 file1 file2 | comm -23 - file3 prints a list of utilities in file1 not specified by either of the other files. The entry: example% comm -12 file1 file2 | comm -12 - file3 prints a list of utilities specified by all three files. And the entry: example% comm -12 file2 file3 | comm -23 -file1 prints a list of utilities specified by both file2 and file3, but not specified in file1. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of comm: LANG, LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 All input files were successfully output as specified. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWesu | +-----------------------------+-----------------------------+ |CSI |enabled | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
cmp(1), diff(1), sort(1), uniq(1), attributes(5), environ(5), largefile(5), standards(5) SunOS 5.10 3 Mar 2004 comm(1)