Return-Path: owner-postman
Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with SMTP id VAA13647 for postgres-redist; Fri, 9 Sep 1994 21:50:39 -0700
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199409100450.VAA13647@nobozo.CS.Berkeley.EDU>
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from faerie.CS.Berkeley.EDU (faerie.CS.Berkeley.EDU [128.32.37.53]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with ESMTP id VAA13637 for <postgres@postgres.Berkeley.EDU>; Fri, 9 Sep 1994 21:50:38 -0700
Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by faerie.CS.Berkeley.EDU (8.6.9/8.1B) with SMTP id VAA13032; Fri, 9 Sep 1994 21:50:37 -0700
Message-Id: <199409100450.VAA13032@faerie.CS.Berkeley.EDU>
X-Authentication-Warning: faerie.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol
From: aoki@cs.berkeley.edu (Paul M. Aoki)
To: postgres@postgres.Berkeley.EDU
Reply-To: aoki@cs.berkeley.edu (Paul M. Aoki)
Subject: [comp.databases: POSTGRES and C++ program compilation--------]
Date: Fri, 09 Sep 94 21:50:31 -0700
X-Sender: aoki@postgres.Berkeley.EDU
Resent-To: postgres-redist@postgres.Berkeley.EDU
X-Mts: smtp
Resent-Date: Fri, 09 Sep 94 21:50:39 -0700
Resent-XMts: smtp

------- Forwarded Message

 Newsgroups:  comp.databases
 From:  Paul M. Aoki <aoki@faerie.CS.Berkeley.EDU>
 Subject:  Re: POSTGRES and C++ program compilation--------
 Date:  10 Sep 1994 04:49:35 GMT

 ima@aphrodite.cs.wayne.edu (I.A.) writes:
 >If any one knows the solution, I will appreciate the reply. My question is 
 >related to the compilation of a sample C++ program given in the subdir 
 >postgres/src/contrib/cplusplus/pgtest.c of version 4.2. I am trying to 
 >compile this sample code using AT&T C++ compiler version 1.3 on sun sparc
 >workstation using SunOS Release 4.1.2.
 >
 >Complier is giving me some error messages which I believe have something to do
 >with the postgres only as my normal C++ programs don't have any problem during
 >compilation. Following is the compilation command and the error messages:
 >
 >% CC -I/usr/local/postgres/include pgtest.c
 >"/usr/local/attc++/incl/stdlib.h", line 51: error: two perror()s with c linkage
 >"/usr/local/attc++/incl/malloc.h", line 41: error: two mallinfo()s with c linkage
 >2 errors
 >%
 
 the 0-second workaround is to use g++, which doesn't have this problem.
 
 the 1-second hack-job workaround is:
 
 sealion:aoki (16)> CC -I/private/aoki/postgres/include pgtest.c /private/aoki/postgres/lib/libpq.a
 CC: "/usr/include/stdlib.h", line 169: error: two getopt()s with c linkage (1101)
 CC: "/usr/include/errno.h", line 15: error: two perror()s with c linkage (1101)
 sealion:aoki (17)> CC -D_STDLIB_INCLUDED -I/private/aoki/postgres/include pgtest.c /private/aoki/postgres/lib/libpq.a
 sealion:aoki (18)> 
 
 (the -D symbol to define depends on your stdlib.h)
 
 notice that you need to include libpq.a or the program won't be able
 to link.  (it's included in the Makefile.)
 
 the 10-second hack-job workaround is:
 
 sealion:aoki (79)> rcsdiff pg.h
 RCS file: RCS/pg.h,v
 retrieving revision 1.2
 rdiff  -r1.2 pg.h
 15d14
 < #include <string.h>
 21a21
 > #include "tmp/c.h"
 27a28,29
 > 
 > #include <string.h>
 sealion:aoki (80)> 

------- End of Forwarded Message
--
  Paul M. Aoki          |  University of California at Berkeley
  aoki@CS.Berkeley.EDU  |  Dept. of EECS, Computer Science Division (#1776) 
                        |  Berkeley, CA 94720-1776

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
