Re: Statically linking against libpq

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John DeSoi <desoi(at)pgedit(dot)com>
Cc: Matthew Metnetsky <met(at)uberstats(dot)com>, Pgsql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Statically linking against libpq
Date: 2005-01-17 22:52:46
Message-ID: 11977.1106002366@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

John DeSoi <desoi(at)pgedit(dot)com> writes:
> On Jan 17, 2005, at 2:10 PM, Matthew Metnetsky wrote:
>> I'd appreciate any suggestions on getting a statically linked library
>> against libpq. I'm currently compiling on a Fedora Core 3 machine with
>> gcc-2.95.3 against the postgresql-libs-7.4.6-1.FC3.2 package.

> This is what I'm using to create a version of psql on OS X with libpq
> statically linked:

> gcc -no-cpp-precomp -O2 -Wall -Wmissing-prototypes -Wpointer-arith
> -Wendif-labels -fno-strict-aliasing command.o common.o help.o input.o
> stringutils.o mainloop.o copy.o startup.o prompt.o variables.o
> large_obj.o print.o describe.o psqlscan.o tab-complete.o mbprint.o
> ../../../src/interfaces/libpq/libpq.a -L../../../src/interfaces/libpq
> -L../../../src/port -lpgport -lz -lresolv -ldl -lm -o psql

Presumably you are using a fairly vanilla set of configure options, too.
Matthew's missing symbols are Kerberos subroutines, so evidently his
problem is that he configured --with-krb5 but didn't bother to mention
the Kerberos library(s) in his link command.

What I would recommend if you want a plugin substitute for the RPM
version of the library is to rebuild from the corresponding SRPM
and look at the log output to determine what options were used and what
libraries need to be mentioned while linking libpq.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Cornelia Boenigk 2005-01-17 23:14:39 Question on output of VACUUM VERBOSE
Previous Message John DeSoi 2005-01-17 21:32:14 Re: Statically linking against libpq