Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hp-pcd!hpfcso!hpfcbig!winters From: winters@hpfcbig.SDE.HP.COM (Daryl Winters) Newsgroups: comp.sys.apollo Subject: Re: Inlib'ing on SR10.1/2 Message-ID: <10270001@hpfcbig.SDE.HP.COM> Date: 7 Sep 90 19:56:57 GMT References: Organization: HP SESD, Fort Collins, CO Lines: 29 You need to compile using '-pic' (position independant code) in order to make a shared library. Make the following changes to your Makefile: ------------------------------------------------------------------------- # Makefile hp: hp_main.o hp_foo.lib ld -o hp hp_main.o -A inlib,hp_foo.lib hp_main.o : hp_main.c hp_foo.lib # -A inlib is needed to help the compiler generate pic calls cc -A inlib,hp_foo.lib -c hp_main.c hp_foo.o : hp_foo.c # -W0,-pic is needed in order to create pic code for the library cc -W0,-pic -c hp_foo.c hp_foo.lib : hp_foo.o # -r AND -a is needed in order to generate a relocatable shared library ld -r -a -o hp_foo.lib hp_foo.o ------------------------------------------------------------------------- It is the combination of -W0,-pic on the compile plus -r -a on the link which will permit you to create and access a shared library. Hope this helps, Daryl Winters (Just a Bozo)