X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 02243D1B433 for ; Mon, 8 Dec 2003 13:59:50 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 21132-09 for ; Mon, 8 Dec 2003 09:59:23 -0400 (AST) Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by svr1.postgresql.org (Postfix) with ESMTP id D2E70D1B483 for ; Mon, 8 Dec 2003 09:59:18 -0400 (AST) Received: from lfix.demon.co.uk ([80.177.205.209] helo=cerberus.lfix.co.uk) by anchor-post-32.mail.demon.net with esmtp (Exim 3.35 #1) id 1ATLux-0006NR-0W; Mon, 08 Dec 2003 13:59:19 +0000 Received: from linda.lfix.co.uk ([192.168.1.1]) by cerberus.lfix.co.uk with esmtp (Exim 4.24) id 1ATLun-0002OV-6N; Mon, 08 Dec 2003 13:59:09 +0000 Subject: Re: error in code From: Oliver Elphick To: Ashok Chauhan Cc: pgsql-admin In-Reply-To: <1070891730.1268.18.camel@chi> References: <1070891730.1268.18.camel@chi> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1070891919.4733.69.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Mon, 08 Dec 2003 13:58:39 +0000 Content-Transfer-Encoding: 7bit X-LFIX-MailScanner: Found to be clean X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/88 X-Sequence-Number: 11596 On Mon, 2003-12-08 at 13:55, Ashok Chauhan wrote: > I make the following code with the make command but give the following > the errors:- > > /tmp/ccUWs9W9.o: In function `main': > /tmp/ccUWs9W9.o(.text+0x19): undefined reference to `PQconnectdb' > /tmp/ccUWs9W9.o(.text+0x2f): undefined reference to `PQexec' > /tmp/ccUWs9W9.o(.text+0x40): undefined reference to `PQntuples' > /tmp/ccUWs9W9.o(.text+0x64): undefined reference to `PQclear' > /tmp/ccUWs9W9.o(.text+0x72): undefined reference to `PQfinish' > collect2: ld returned 1 exit status > make: *** [aa] Error 1 These are link errors. You need to add -lpq to the link command line (and possibly -Lpath for the libpq library path as well). -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "For I am the LORD your God; ye shall therefore sanctify yourselves, and ye shall be holy; for I am holy." Leviticus 11:44