Problems linking with libpq

Поиск
Список
Период
Сортировка
От Flemming Froekjaer
Тема Problems linking with libpq
Дата
Msg-id 3B61F000.6A101A01@froekjaer.org
обсуждение исходный текст
Ответы Re: Problems linking with libpq  ("Oliver Elphick" <olly@lfix.co.uk>)
Список pgsql-general
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);
}

\Flemming


В списке pgsql-general по дате отправления:

Предыдущее
От: Mike Mascari
Дата:
Сообщение: Re: RE: [SQL] Database Design Question
Следующее
От: "Oliver Elphick"
Дата:
Сообщение: Re: Problems linking with libpq