Re: Problems linking with libpq

From: missive(at)frontiernet(dot)net (Lee Harr)
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Problems linking with libpq
Date: 2001-07-28 14:58:44
Message-ID: 9jujv3$3pk6$2@node21.cwnet.roc.gblx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 27 Jul 2001 22:57:36 +0000 (UTC), <flemming(at)froekjaer(dot)org> wrote:
> I'm trying to compile a small c program that integrates with PostgreSQL,
>
> but when I get to link the prog i get the following error.
>
> /tmp/ccFrRISc.o: In function `main':
> /tmp/ccFrRISc.o(.text+0x57): undefined reference to `PQsetdbLogin'
>
> I'm doing this on FreeBSD 4.3 and PostgreSQL is 7.1.2
>
> I made this prog to determine that what causes the problem:
>
> #include </usr/local/include/pgsql/libpq-fe.h>
>
> int main (void) {
> char *pghost,
> *pgport,
> *pgoptions,
> *pgtty,
> *dbUser,
> *dbPassword;
> char *dbName;
> int nFields;
> int i, j;
> PGconn *conn;
>
> pghost = "localhost";
> pgport = "5432";
> pgoptions = NULL;
> pgtty = NULL;
> dbName = "monitor";
> dbUser = "username";
> dbPassword = "donttell";
>
> conn = PQsetdbLogin(pghost, pgport, pgoptions, pgtty, dbName, dbUser,
> dbPassword);
> return(0);
> }
>

What is the command line you are using to compile & link your program?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Eric Ridge 2001-07-28 18:10:35 RE: Visual Basic and PostgreSQL ODBC
Previous Message Lee Harr 2001-07-28 14:54:42 Re: createdb after initdb