Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Tim Lucia <lucia@zko.dec.com>
To: mlb@fersys.demon.co.uk
Subject: Re: How do I create a shared library?
Date: 1996/07/19	[thread overview]
Message-ID: <31EF8CAA.2D85@zko.dec.com> (raw)
In-Reply-To: 837508279.640.0@fersys.demon.co.uk

[-- Attachment #1: Type: text/plain, Size: 386 bytes --]

Here is a simple example of creating a shared library and calling a routine
within.\x18\x13

Regards,
Tim
-- 
Timothy J. Lucia                         Email:    mailto:lucia@zko.dec.com
Digital Equipment Corporation            Phone:           603.881.2615
110 Spitbrook Road ZK2-3Q08              Fax:             603.881.0120
Nashua, NH  USA  03062-2698              I'd rather be cycling.

[-- Attachment #2: SHARED_LIBRARY_EXAMPLE --]
[-- Type: text/plain, Size: 986 bytes --]



Jul 19 09:23 1996 library.c Page 1


#include <stdio.h>

void bar(void)
{
    printf("Inside shared library:bar()\n");
}

























































Jul 19 09:23 1996 main.c Page 1


#include <stdio.h>

void main(void)
{
    extern void bar(void);
    printf("Inside of main\n");
    bar();
}























































Jul 19 09:22 1996 makefile Page 1


#
# Simple example of how to build a shared library on Digital UNIX(tm).
# Written by: Timothy J. Lucia, lucia@zko.dec.com
#

DEBUGFLAGS	= -g -O0
CCFLAGS		= $(DEBUGFLAGS)
CC		= cc $(CCFLAGS)
LDFLAGS		= $(DEBUGFLAGS)
LD		= ld $(LDFLAGS)
RM		= rm -f

all:	main library.so

main:	main.o library.so
	$(CC) -o main main.o library.so

main.o:	main.c
	$(CC) -c main.c

library.so:	library.o
	$(LD) -shared -o library.so library.o -lc

library.o:	library.c
	$(CC) -c library.c

clean:
	$(RM) main library main.o library.o library.so so_locations


































  parent reply	other threads:[~1996-07-19  4:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <837508279.640.0@fersys.demon.co.uk>
1996-07-16  4:00 ` How do I create a shared library? John Hascall
1996-07-19  4:00 ` Tim Lucia [this message]
1996-07-19  4:00   ` Tim Lucia
     [not found] <837524411.9835.0@fersys.demon.co.uk>
1996-07-21  4:00 ` Steve Peltz
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox