Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D8D18475D9F for ; Sun, 1 Sep 2002 23:48:55 -0400 (EDT) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 6C528475BB3 for ; Sun, 1 Sep 2002 23:48:55 -0400 (EDT) Received: by news.hub.org (Postfix, from userid 8) id 958BE381D43; Sun, 1 Sep 2002 23:48:52 -0400 (EDT) From: rexrecio@yahoo.com (Rex Recio) X-Newsgroups: comp.databases.postgresql.interfaces Subject: 7.2.1 failure to complie C programs Date: 1 Sep 2002 20:37:43 -0700 Organization: http://groups.google.com/ Lines: 40 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-interfaces@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/21 X-Sequence-Number: 3082 I have been trying to compile my first C program on PostgreSQL 7.1.2. Here is my source code: /*filename is hello.c*/ #include #include "libpq-fe.h" int main (int argc, char *argv[]) { PGConn *masterConn; printf("Hello World!\n"); masterConn = PQconnectdb("hostaddr=192.168.0.23 dbname=masterdb user=postgres password=postgres"); return 1; } I tried compliling it using gcc -c hello.c but it gives me the following error: hello.c: In function `main': hello.c:6: `PGConn' undeclared (first use in this function) hello.c:6: (Each undeclared identifier is reported only once hello.c:6: for each function it appears in.) hello.c:6: `masterConn' undeclared (first use in this function) The include file for POstgreSQL is already located at the /usr/include. Nevertheless I also tried specifying it in the complier. I tried compiling using: gcc -c hello.c -I/usr/include gcc -c hello.c -I/usr/include/pgsql I got the same error. I'm using RedHat 7.3 and the default Postgres installation that comes with it, 7.2.1. I noticed that there is an 'undeclared error' for PGConn but not for 'PQConnectdb'. I examnined the header file and true enough there is no declaration for PGConn. Is there anybody out there who had the same experience and was able to fix it? Please help.