X-Original-To: pgsql-interfaces@postgresql.org Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by postgresql.org (Postfix) with ESMTP id A975D476306 for ; Thu, 6 Mar 2003 23:06:59 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id h2746nD19275; Thu, 6 Mar 2003 23:06:49 -0500 (EST) From: Bruce Momjian Message-Id: <200303070406.h2746nD19275@candle.pha.pa.us> Subject: Re: Darwin libpq link failing In-Reply-To: <18653.1046627309@sss.pgh.pa.us> To: Tom Lane Date: Thu, 6 Mar 2003 23:06:49 -0500 (EST) Cc: ash , pgsql-interfaces@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200303/15 X-Sequence-Number: 3764 Tom Lane wrote: > ash writes: > > gcc -O -pipe -Wall -g -Dbugs -I/Users/xpi/tmpsrc/lib/mutilities -L/Users/xpi/tmpsrc/lib/mutilities -Dpthreads -Ddarwin -I/usr/local/pgsql/include -L/usr/local/pgsql/lib -lpq -lpq mutil.o maintest.c > > ld: Undefined symbols: > > _PQclear > > _PQerrorMessage > > _PQsetdbLogin > > Surely the library reference must come after the files that reference > it. Right. Some linkers seem to do reordering themselves, while others require the ordering to be specified in the proper dependency order; I prefer a linker that doesn't do any reordering itself --- it can lead to surprises and doesn't handle well cases where the same symbol is defined in multiple libraries. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073