Thread

  1. Problems compiling test program program form pgsql

    Miguel Fernandez <miguelfernandez@bridge.com.br> — 2000-06-03T21:57:03Z

        Hi , I've got a problem compiling the test program in the programmers guide.
        t frist how I do to link libpg.a in gcc and g++ ?
         
        Later I've got the screen :
    
        $bash: g++ test.C -o test.o -o test /usr/lib/libpg.a     // my libpg.a is in /usr/lib
         /usr/lib/libpq.a (fe-auth.o) : in function 'pg_password_sendauth' :
         fe_auth.o(.text+0x27):undefined reference to 'crypt'
         collect2 : ld reurned 1 exit status 
        $bash :
    
    Note : my computer runs a linux red hat Conectiva 3.0 installed with postgres 6.5.2.
    
    If someone can help-me I will be very gateful .
    
  2. Re: Problems compiling test program program form pgsql

    D. Duccini <duccini@backpack.com> — 2000-06-04T02:16:40Z

    you're missing an install of the crypt library, which seems kind of odd,
    since i thought that was a standard part
    
    look in /usr/lib
    
    you should have two files and one symbolic link:
    
     /usr/lib % dir libcry*
    -rw-r--r--   1 root     root        98012 Sep 20  1999 libcrypt.a
    lrwxrwxrwx   1 root     root           23 Sep 19  1998 libcrypt.so ->../../lib/libcrypt.so.1
    -rw-r--r--   1 root     root        98908 Sep 20  1999 libcrypt_p.a
    
    
    
    
    On Sat, 3 Jun 2000, Miguel Fernandez wrote:
    
    >     Hi , I've got a problem compiling the test program in the programmers guide.
    >     t frist how I do to link libpg.a in gcc and g++ ?
    >      
    >     Later I've got the screen :
    > 
    >     $bash: g++ test.C -o test.o -o test /usr/lib/libpg.a     // my libpg.a is in /usr/lib
    >      /usr/lib/libpq.a (fe-auth.o) : in function 'pg_password_sendauth' :
    >      fe_auth.o(.text+0x27):undefined reference to 'crypt'
    >      collect2 : ld reurned 1 exit status 
    >     $bash :
    > 
    > Note : my computer runs a linux red hat Conectiva 3.0 installed with postgres 6.5.2.
    > 
    > If someone can help-me I will be very gateful .
    > 
    
    
    -----------------------------------------------------------------------------
    david@backpack.com            BackPack Software, Inc.        www.backpack.com
    +1 651.645.7550 voice       "Life is an Adventure.    
    +1 651.645.9798 fax            Don't forget your BackPack!"   
    -----------------------------------------------------------------------------
    
    
    
  3. Re: Problems compiling test program program form pgsql

    Hugh Lawson <hlawson@triad.rr.com> — 2000-06-04T02:47:56Z

    On Sat, 3 Jun 2000, Miguel Fernandez wrote:
    
    >     Hi , I've got a problem compiling the test program in the programmers guide.
    >     t frist how I do to link libpg.a in gcc and g++ ?
    >      
    >     Later I've got the screen :
    > 
    >     $bash: g++ test.C -o test.o -o test /usr/lib/libpg.a     // my libpg.a is in /usr/lib
    >      /usr/lib/libpq.a (fe-auth.o) : in function 'pg_password_sendauth' :
    >      fe_auth.o(.text+0x27):undefined reference to 'crypt'
    
    I believe that if you add a '-l' option to your compile command it will
    work:
    
    <To your presend command add>  -lcrypt
     
    
    
    
    --
    Hugh Lawson
    Greensboro, North Carolina
    hlawson@triad.rr.com
    
    
    
    
  4. Re: Problems compiling test program program form pgsql

    Karl F. Larsen <k5di@zianet.com> — 2000-06-08T22:50:24Z

    Hi Hugh, it looks like -l must have worked. I use that when I need the
    math libs.
    
    On Sat, 3 Jun 2000, Hugh Lawson wrote:
    
    > On Sat, 3 Jun 2000, Miguel Fernandez wrote:
    > 
    > >     Hi , I've got a problem compiling the test program in the programmers guide.
    > >     t frist how I do to link libpg.a in gcc and g++ ?
    > >      
    > >     Later I've got the screen :
    > > 
    > >     $bash: g++ test.C -o test.o -o test /usr/lib/libpg.a     // my libpg.a is in /usr/lib
    > >      /usr/lib/libpq.a (fe-auth.o) : in function 'pg_password_sendauth' :
    > >      fe_auth.o(.text+0x27):undefined reference to 'crypt'
    > 
    > I believe that if you add a '-l' option to your compile command it will
    > work:
    > 
    > <To your presend command add>  -lcrypt
    >  
    > 
    > 
    > 
    > --
    > Hugh Lawson
    > Greensboro, North Carolina
    > hlawson@triad.rr.com
    > 
    > 
    > 
    > 
    
    Yours Truly,
    
      	 - Karl F. Larsen, k5di@arrl.net  (505) 524-3303  -