Received: from wallace.ece.rice.edu (wallace.ece.rice.edu [128.42.12.154]) by hub.org (8.10.1/8.11.0) with ESMTP id e9RNFXZ72551 for ; Fri, 27 Oct 2000 19:15:33 -0400 (EDT) (envelope-from reedstrm@rice.edu) Received: by rice.edu via sendmail from stdin id (Debian Smail3.2.0.102) for pgsql-interfaces@postgresql.org; Fri, 27 Oct 2000 18:15:28 -0500 (CDT) Date: Fri, 27 Oct 2000 18:15:28 -0500 From: "Ross J. Reedstrom" To: "Gustavo R. Bonet" Cc: pgsql-interfaces@postgresql.org Subject: Re: C program compilation Message-ID: <20001027181528.A10276@rice.edu> Mail-Followup-To: "Gustavo R. Bonet" , pgsql-interfaces@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: ; from gbonet@bna.com.ar on Fri, Oct 27, 2000 at 01:07:12PM -0300 X-Archive-Number: 200010/248 X-Sequence-Number: 1607 On Fri, Oct 27, 2000 at 01:07:12PM -0300, Gustavo R. Bonet wrote: > I'm a beginner in PostGreSQL and I'm trying to meka my first interface with > a C > program. > > Like the documentation says, I'm using the following sentence to compile: > > gcc -o output_name -I /usr/include/pgsql -lpq myprogram.c > > But, in two diferent Linux servers the answer was: > > /usr/lib/libpq.so: undefined reference to `crypt' > collect2: ld returned 1 exit status > > I have tryed with millons ways changing the order, including other paths, > etc. ... and > nothing. Ah, but did you try to find out where crpyt is defined on your system? I bet it's in a libcrypt (it used to be in libc), so try something like: gcc -o output_name -I /usr/include/pgsql -lpq -lcrypt myprogram.c Ross Reedstrom -- Open source code is like a natural resource, it's the result of providing food and sunshine to programmers, and then staying out of their way. [...] [It] is not going away because it has utility for both the developers and users independent of economic motivations. Jim Flynn, Sunnyvale, Calif.