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

Problem linkint with libpq

From: Flemming Froekjaer <flemming(at)froekjaer(dot)org>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Problem linkint with libpq
Date: 2001-07-27 21:33:48
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
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 determin that what causes the problem:

#include </usr/local/include/pgsql/libpq-fe.h>

int main (void) {
  char *pghost,
  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,


pgsql-interfaces by date

Next:From: Cedar CoxDate: 2001-07-29 08:35:09
Subject: bug (lack of feature) in psql
Previous:From: Bruce MomjianDate: 2001-07-26 21:22:32
Subject: Re: WIN32 MULTIBYTE

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