pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
C program compilation
4+ messages / 4 participants
[nested] [flat]

* C program compilation
@ 2000-10-27 16:07 Gustavo R. Bonet <gbonet@bna.com.ar>
  2000-10-27 22:15 ` Re: C program compilation Alfred Perlstein <bright@wintelcom.net>
  2000-10-27 23:15 ` Re: C program compilation Ross J. Reedstrom <reedstrm@rice.edu>
  2000-10-28 01:37 ` Re: C program compilation Thomas Lockhart <lockhart@alumni.caltech.edu>
  0 siblings, 3 replies; 4+ messages in thread

From: Gustavo R. Bonet @ 2000-10-27 16:07 UTC (permalink / raw)
  To: pgsql-interfaces

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.

If you have the answer or can guide me to some "doc", please response this
mail to:

gbonet@bna.com.ar

Thank you !

Gustavo R. Bonet
Buenos Aires
Argentina




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: C program compilation
  2000-10-27 16:07 C program compilation Gustavo R. Bonet <gbonet@bna.com.ar>
@ 2000-10-27 22:15 ` Alfred Perlstein <bright@wintelcom.net>
  2 siblings, 0 replies; 4+ messages in thread

From: Alfred Perlstein @ 2000-10-27 22:15 UTC (permalink / raw)
  To: Gustavo R. Bonet <gbonet@bna.com.ar>; +Cc: pgsql-interfaces

* Gustavo R. Bonet <gbonet@bna.com.ar> [001027 14:54] 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

try adding '-lcrypt' to the compile flags.

-Alfred (who also stumbled on this)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: C program compilation
  2000-10-27 16:07 C program compilation Gustavo R. Bonet <gbonet@bna.com.ar>
@ 2000-10-27 23:15 ` Ross J. Reedstrom <reedstrm@rice.edu>
  2 siblings, 0 replies; 4+ messages in thread

From: Ross J. Reedstrom @ 2000-10-27 23:15 UTC (permalink / raw)
  To: Gustavo R. Bonet <gbonet@bna.com.ar>; +Cc: pgsql-interfaces

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.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: C program compilation
  2000-10-27 16:07 C program compilation Gustavo R. Bonet <gbonet@bna.com.ar>
@ 2000-10-28 01:37 ` Thomas Lockhart <lockhart@alumni.caltech.edu>
  2 siblings, 0 replies; 4+ messages in thread

From: Thomas Lockhart @ 2000-10-28 01:37 UTC (permalink / raw)
  To: Gustavo R. Bonet <gbonet@bna.com.ar>; +Cc: pgsql-interfaces

> Like the documentation says, I'm using the following sentence to compile:
> gcc -o output_name -I /usr/include/pgsql -lpq myprogram.c
> /usr/lib/libpq.so: undefined reference to `crypt'
> collect2: ld returned 1 exit status

Try adding "-lcrypt" to the line.

                    - Thomas



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2000-10-28 01:37 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-10-27 16:07 C program compilation Gustavo R. Bonet <gbonet@bna.com.ar>
2000-10-27 22:15 ` Alfred Perlstein <bright@wintelcom.net>
2000-10-27 23:15 ` Ross J. Reedstrom <reedstrm@rice.edu>
2000-10-28 01:37 ` Thomas Lockhart <lockhart@alumni.caltech.edu>

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