Skip site navigation (1) Skip section navigation (2)

linking error

From: "anuj" <Anuj(at)in-control(dot)de>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: linking error
Date: 2000-07-04 05:43:59
Message-ID: 03e301bfe57c$d1f12350$6a01010a@incontrolint.in (view raw or flat)
Thread:
Lists: pgsql-hackers
 There is a small  'C' program.
 Compile successfully and linking error is coming in PQsetdbLogin function.
 This program will run on Linux RH6. How to remove this linking error.
Or
Any other way to connect to backend PostgrsSQL via 'C' program. 
Please waiting your valuable guidance.
Thanx. 
Anuj
 
 
 ******* Compile Result ************
 [rootanuj(at)Lux2 rootanuj]$ gcc -S conn.c
 [rootanuj(at)Lux2 rootanuj]$ gcc conn.c
 /tmp/ccroTWA2.o: In function `main':
 /tmp/ccroTWA2.o(.text+0x48): undefined reference to `PQsetdbLogin'
 collect2: ld returned 1 exit status
 [rootanuj(at)Lux2 rootanuj]$
 *******************************
 
 /* conn.c */
 #include <stdio.h>
 #include "/usr/include/pgsql/libpq-fe.h"
 main()
   {
       char       *pghost,  *pgport,   *pgoptions,  *pgtty;
       char       *dbName;

       PGconn     *conn;
 
       pghost = NULL;              /* host name of the backend server */
       pgport = "5432";              /* port of the backend server */
       pgoptions = NULL;           /* special options to start up the backend server */
       pgtty = NULL;               /* debugging tty for the backend server */
       dbName = "Mydb";
 
       /* make a connection to the database */
       conn = PQsetdbLogin(pghost, pgport, pgoptions, pgtty,dbName,"username","password");
 /* Compile successfully and linking error is coming in PQsetdb function. */
 /* Compile cc -S conn.c */
   }
 
 
 

In response to

pgsql-hackers by date

Next:From: Jeroen Ruigrok/AsmodaiDate: 2000-07-04 06:19:34
Subject: Re: Re: [HACKERS] proposed improvements to PostgreSQL license
Previous:From: Bruce MomjianDate: 2000-07-04 05:27:22
Subject: Re: AW: AW: AW: Modified pg_dump & new pg_restore need testing...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group