X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 52E9D8B9EA8 for ; Tue, 8 Feb 2005 06:31:23 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55822-08 for ; Tue, 8 Feb 2005 06:31:07 +0000 (GMT) Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.250.190.2]) by svr1.postgresql.org (Postfix) with ESMTP id 321868B9C03 for ; Tue, 8 Feb 2005 06:31:06 +0000 (GMT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 7462531D94; Tue, 8 Feb 2005 07:26:47 +0100 (MET) From: Jim Morcombe X-Newsgroups: pgsql.interfaces Subject: A problem with libpq Date: Tue, 08 Feb 2005 11:08:19 +0800 Lines: 42 Message-ID: <36qoq4F54bg5qU1@individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en To: pgsql-interfaces@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/27 X-Sequence-Number: 5272 Can anyone help me with this problem? I have installed postgresql-7.2.1 and am trying to compile one of the test programs from the directory src/test/examples. I have compiled the example successfully on my Red Hat Linux machine and now need to compile it on my SCO machine but keep getting errors that seem to mean that I have forgotten to use the "-lpq" option when compiling. I am running an old version of SCO Openserver 5 I am using the following command: cc testlibpq.c -I/usr/local/pgsql/include -L/usr/local/pgsql/lib -lpq -otestlibpq I receive the following error messages: undefined first referenced symbol in file PQfinish testlibpq.o PQsetdbLogin testlibpq.o PQstatus testlibpq.o PQerrorMessage testlibpq.o PQexec testlibpq.o PQresultStatus testlibpq.o PQclear testlibpq.o PQnfields testlibpq.o PQfname testlibpq.o PQgetvalue testlibpq.o PQntuples testlibpq.o ld fatal: Symbol referencing errors. No output written to testlibpq As far as I can see (and I am unfamiliar with libraries, etc) /usr/local/pgsql/lib seems okay. It has the following files in it: -rw-r--r-- 1 root sys 79756 Jul 30 2002 libpq.a -rwxr-xr-x 1 root sys 67600 Jul 30 2002 libpq.so@ -rwxr-xr-x 1 root sys 67600 Jul 30 2002 libpq.so.2@ -rwxr-xr-x 1 root sys 67600 Jul 30 2002 libpq.so.2.2 In my ignorance, I take it that libpq.so.2.2 is the real file and that libpq.so is simply a link to it.