X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id AACD8CC326 for ; Tue, 15 Jul 2003 09:27:41 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 94115-09 for ; Tue, 15 Jul 2003 09:28:05 +0000 (GMT) Received: from mail024.syd.optusnet.com.au (mail024.syd.optusnet.com.au [210.49.20.148]) by svr1.postgresql.org (Postfix) with ESMTP id 7218CCC30B for ; Tue, 15 Jul 2003 06:27:38 -0300 (ADT) Received: from 192.168.0.2 (c17130.rochd1.qld.optusnet.com.au [210.49.54.243] (may be forged)) by mail024.syd.optusnet.com.au (8.11.6p2/8.11.6) with ESMTP id h6F9S5A17951 for ; Tue, 15 Jul 2003 19:28:05 +1000 Subject: Connecting - Need Help ! From: Peter Moscatt Reply-To: pgmoscatt@optushome.com.au To: "PostgreSQL [INTERFACES] " List Content-Type: text/plain Organization: Message-Id: <1058261289.3691.4.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4-1.1mdk Date: 15 Jul 2003 19:28:09 +1000 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/20 X-Sequence-Number: 4334 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