Subject: Using LIBPQ in C++ program

From: [email-masked] (Siu Wah Lau)
Date: Thu, 15 Apr 93 16:58:27 -0700

I have problem with compiling the following C++ program:

#include "tmp/libpq.h"

main(void)
{
	char * c = new char[20];
}

The compiler reports the following error when I compile the program:

try.cc: 5: new: argument mismatch
"try.cc", line 5: error: syntax error

The error is due to the fact that "new" is a macro defined in
"tmp/c.h" which is included by "tmp/libpq.h".
Hence the "new" operator in C++ cannot be used.

Do anyone know how to overcome this problem?

Thank you.

Clarence.