* Re: How do I create a shared library?
[not found] <837508279.640.0@fersys.demon.co.uk>
@ 1996-07-16 4:00 ` John Hascall
1996-07-19 4:00 ` Tim Lucia
1 sibling, 0 replies; 4+ messages in thread
From: John Hascall @ 1996-07-16 4:00 UTC (permalink / raw)
<mlb@fersys.demon.co.uk> wrote:
}I'm using OSF/1 V3.2c on Alpha platforms, and am puzzled as to how I create
}a shared library.
}I've looked at manual pages for "cc", "ld" and "ar", and done a "man -k"
}for "shared" and "library", but am none the wiser.
It's in the Programmer's Guide in the BookReader.
Anyway, here's an example:
ld -shared -no_archive -o libfoo.so foo1.o foo2.o foo3.o -lc
John
--
John Hascall, Software Engr. Shut up, be happy. The conveniences you
ISU Computation Center demanded are now mandatory. -Jello Biafra
john@iastate.edu
http://www.cc.iastate.edu/staff/systems/john/welcome.html <-- the usual crud
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: How do I create a shared library?
[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
1996-07-19 4:00 ` Tim Lucia
1 sibling, 1 reply; 4+ messages in thread
From: Tim Lucia @ 1996-07-19 4:00 UTC (permalink / raw)
To: mlb
[-- 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
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: How do I create a shared library?
1996-07-19 4:00 ` Tim Lucia
@ 1996-07-19 4:00 ` Tim Lucia
0 siblings, 0 replies; 4+ messages in thread
From: Tim Lucia @ 1996-07-19 4:00 UTC (permalink / raw)
To: Tim Lucia
I should have mentioned also that you should
export LD_LIBRARY_PATH=.
setenv LD_LIBRARY_PATH .
Whichever is appropriate to your shell.
--
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <837524411.9835.0@fersys.demon.co.uk>]
* Re: How do I create a shared library?
[not found] <837524411.9835.0@fersys.demon.co.uk>
@ 1996-07-21 4:00 ` Steve Peltz
0 siblings, 0 replies; 4+ messages in thread
From: Steve Peltz @ 1996-07-21 4:00 UTC (permalink / raw)
In article <837524411.9835.0@fersys.demon.co.uk>,
<mlb@fersys.demon.co.uk> wrote:
>However I'm getting errors when I try and run the application of the
>form "/sbin/loader: Error: unresolvable symbol", even though
>the functions it can't find are in my shared library!
Try setting the environment variable _RLD_ARGS to:
"-log /tmp/link.log -trace -stat"
This will log what /sbin/loader is doing. It may help you figure out
what you're doing.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1996-07-21 4:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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
1996-07-19 4:00 ` Tim Lucia
[not found] <837524411.9835.0@fersys.demon.co.uk>
1996-07-21 4:00 ` Steve Peltz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox