Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!ut-emx!ibmchs!auschs!awdprime!ausvm1.iinus1.ibm.com!andy From: andy@ausvm1.iinus1.ibm.com (Andy Martin) Newsgroups: comp.unix.aix Subject: Shared library problem Message-ID: <6558@awdprime.UUCP> Date: 10 Apr 91 19:03:15 GMT Sender: news@awdprime.UUCP Reply-To: andy@ruddles.austin.ibm.com Organization: CCOT Department, ESD, IBM, Austin, TX. Lines: 39 I have a number of objects $objs that I want to link into a shared object $obj for addition into an archive. Thses objects depend upon a number of libraries -lc, -lX11, -lbsd, -lnck, etc. When I explictily mention the libriares on the first ld line it works ok: % ld -H512 -T512 -o $shobj $objs -bE:$exp -bM:SRE -lc -lXll -lbsd -lnck % ar rv $shlib $shobj % cc prog.c $shlib % setenv LIBPATH : % a.out % However when I use the -r flag to ignore the unresolved references for a later pass I get the error below. % ld -H512 -T512 -o $shobj $objs -bE:$exp -bM:SRE -r % ar rv $shlib $shobj % cc prog.c $shlib -lXll -lbsd -lnck % setenv LIBPATH : % a.out Could not load program a.out Could not load library $shlib[shobj] Error was: Exec format error % I have tried numerous variations on the same theme and am not having much luck. Some better words of wisdom than the manual provides would be helpful regarding shared libraries and dynamic loading. Andy Martin Cooperating Compound Object Toolkit (CCOT) IBM Personal Systems Programming, 11400 Burnet Road, Austin, TX, 78759. Office: 808/1K-014, Internal Zip: 3008, Phone: (512) 823-1801. INET: amartin@ausvm1.iinus1.ibm.com VNET: AMARTIN at AUSVM1 Austin: andy@ruddles.austin.ibm.com