agora inbox for postgres@postgres.berkeley.edu
help / color / mirror / Atom feedFrom: Paul M. Aoki <aoki@cs.berkeley.edu>
To: postgres@postgres.Berkeley.EDU
Subject: [comp.databases: POSTGRES and C++ program compilation--------]
Date: Fri, 09 Sep 94 21:50:31 -0700
Message-ID: <199409100450.VAA13032@faerie.CS.Berkeley.EDU> (raw)
------- 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.
==============================================================================
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: postgres@postgres.berkeley.edu
Cc: aoki@cs.berkeley.edu
Subject: Re: [comp.databases: POSTGRES and C++ program compilation--------]
In-Reply-To: <199409100450.VAA13032@faerie.CS.Berkeley.EDU>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox