Return-Path: andrew
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA16897; Wed, 14 Jul 93 08:35:58 -0700
Date: Wed, 14 Jul 93 08:35:58 -0700
Message-Id: <9307141535.AA16897@postgres.Berkeley.EDU>
From: "Andrew K. Yu" <andrew@postgres.Berkeley.EDU>
Subject: Re: link failure
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
Cc: andrew@eden.CS.Berkeley.EDU

> In a dynamically loaded c function I using the LO* commands. The code includes
...
> and a successfully compile with the command line :
>	
> cc -c -I/usr/postgres/Release-4.1/include
>	-I/usr/postgres/Release-4.1/include/port/sparc 
>	-I/usr/postgres/Release-4.1/src/backend/obj
>	-I/usr/postgres/Release-4.1/src/backend filename.c 
>	/usr/postgres/Release-4.1/lib/libpq.a

If you compile successfully, you should have the right include files. One
little reminder, you don't need to link in any libraries when you compile
with "cc -c". In this case, libpq.a will not be looked at.

> Howevwer when I attempt to load object file into postgres a warning about a link
> failure is rerturned :
	
> WARN:Jul 14 12:58:26:Load of file /home/t84/M92/cc/hamiltop/postgres/project/database/inv/filename.o failed: link failed!
	
In general, it's hard to tell what happens. It can be anything from 
multiply defined symbols to /tmp full.

To find out what happens, you can do the following outside of postgres:

ld -x -N -A `which postgres` filename.o -lm_G0 -lc_G0

ld should give you a more intelligent message.
	
good luck!

- andrew
