pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Emilio Recio <erecio@storm.jmc.tju.edu>
To: pgsql-interfaces@postgresql.org
Subject: Re: Cannot Statically Link libpq.a
Date: Wed, 25 Sep 2002 09:57:28 -0400
Message-ID: <3D91C0C8.7050900@storm.jmc.tju.edu> (raw)
References: <3D91B97F.6090002@storm.jmc.tju.edu>
	<20020925144640.A7424@quartz.newn.cam.ac.uk>

Patrick Welche wrote:
> Very long shot: what if you move the -lpq to the end?
> 
> gcc -o testpq -static testpq.c -lpq

YOU ROCK!

erecio@datacollector1:$ make
gcc -static -o testpg -L. testpg.o -lpq
./libpq.a(fe-auth.o): In function `pg_password_sendauth':
fe-auth.o(.text+0x148): undefined reference to `crypt'
collect2: ld returned 1 exit status
make: *** [pgconn] Error 1

-- after editing the makefile

$ make
gcc -static -o testpg -L. testpg.o -lpq -lcrypt
strip testpg && size testpg
    text    data     bss     dec     hex filename
  437341   11488  165800  614629   960e5 pgconn

$ ldd testpg
         not a dynamic executable

I've been away from C for too long... QT has pampered me and PHP has 
made me lazy. Java well... has made me take everything for granted. :) 
Hopefully this list is archived so someone else doesn't make that same 
'oops'. Thanks a lot.

~Elmo




view thread (3+ messages)

Message-ID: <3D91C0C8.7050900@storm.jmc.tju.edu>
Permalink:  ../3D91C0C8.7050900@storm.jmc.tju.edu/
Also on:    postgresql.org/message-id/3D91C0C8.7050900@storm.jmc.tju.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: erecio@storm.jmc.tju.edu
  Subject: Re: Cannot Statically Link libpq.a
  In-Reply-To: <3D91C0C8.7050900@storm.jmc.tju.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox