Thread

  1. postgres in 'C' - can't get started

    Graeme Stobbart <graeme@peters.co.uk> — 2001-01-22T16:39:14Z

    Red Hat 7, Vanilla install postgres from RPM's
    
    Create very simple program to open/close (cut down vsn of example 1)
    
    Compile using libpq.a
    
    Follwing error...
    
    /usr/lib/libpq.a (fe-auth.a): In function `pg_password_sendauth`:
    fe-auth.o(.text+0x30): undefined reference to `crypt`
    
    New to postgres, have I missed something?  Reply, however terse, much appreciated.
    Thanks
    Tom K
    
  2. Re: postgres in 'C' - can't get started

    Tom Lane <tgl@sss.pgh.pa.us> — 2001-01-24T04:59:35Z

    "Graeme Stobbart" <graeme@peters.co.uk> writes:
    > /usr/lib/libpq.a (fe-auth.a): In function `pg_password_sendauth`:
    > fe-auth.o(.text+0x30): undefined reference to `crypt`
    
    On some platforms you need to specify -lcrypt explicitly when linking.
    (Sometimes crypt() is in the standard library, sometimes not.)
    
    			regards, tom lane