pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Moscatt <pgmoscatt@optushome.com.au>
To: "PostgreSQL [INTERFACES] " List <pgsql-interfaces@postgresql.org>
Subject: Connecting - Need Help !
Date: 15 Jul 2003 19:28:09 +1000
Message-ID: <1058261289.3691.4.camel@localhost> (raw)

I am trying my first attempt to write code which will conect to a test
database I have created.

The code I used is shown below:

void ConnectDatabase()
{
  char *pghost;
  char *pgport;
  char *pgoptions;
  char *pgtty;
  char *dbName;

  PGconn *conn;
  PGresult *res;

  pghost = NULL;
  pgport = NULL;
  pgoptions = NULL;
  dbName = "linlog";

  conn = PQsetdb(pghost,pgport,pgoptions,pgtty,dbName);
}




When I compile and make I get the following error:

linlog.o(.text+0x177): In function `ConnectDatabase()': 
/home/pmoscatt/C++/linlog/linlog/linlog.cpp:30: undefined reference to
`PQsetdbLogin' 
collect2: ld returned 1 exit status 
gmake[2]: *** [linlog] Error 1 
gmake[2]: Leaving directory `/home/pmoscatt/C++/linlog/linlog' 
gmake[1]: Leaving directory `/home/pmoscatt/C++/linlog' 
gmake[1]: *** [all-recursive] Error 1 
gmake: *** [all-recursive-am] Error 2 
*** failed *** 



What have I done wrong here ??

Pete




view thread (3+ messages)  latest in thread

Message-ID: <1058261289.3691.4.camel@localhost>
Permalink:  ../1058261289.3691.4.camel@localhost/
Also on:    postgresql.org/message-id/1058261289.3691.4.camel@localhost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: pgmoscatt@optushome.com.au
  Subject: Re: Connecting - Need Help !
  In-Reply-To: <1058261289.3691.4.camel@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox