Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id ED9024766AC for ; Wed, 25 Sep 2002 09:57:24 -0400 (EDT) Received: from storm.jmc.tju.edu (storm.jmc.tju.edu [147.140.155.140]) by postgresql.org (Postfix) with ESMTP id 401EE47665E for ; Wed, 25 Sep 2002 09:57:24 -0400 (EDT) Received: from storm.jmc.tju.edu (noir.jmc.tju.edu [147.140.160.249]) by storm.jmc.tju.edu (8.11.6/8.11.2) with ESMTP id g8PDpKw14794 for ; Wed, 25 Sep 2002 09:51:20 -0400 Message-ID: <3D91C0C8.7050900@storm.jmc.tju.edu> Date: Wed, 25 Sep 2002 09:57:28 -0400 From: Emilio Recio Organization: Polywog Systems ( http://polywog.philtered.net ) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Re: Cannot Statically Link libpq.a References: <3D91B97F.6090002@storm.jmc.tju.edu> <20020925144640.A7424@quartz.newn.cam.ac.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/78 X-Sequence-Number: 3139 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