Re: postgresql and C++/C

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: "vdm(dot)fbsd(at)virgilio(dot)it" <vdm(dot)fbsd(at)virgilio(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: postgresql and C++/C
Date: 2005-09-28 09:44:03
Message-ID: 20050928094358.GB2436@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Sep 28, 2005 at 10:11:45AM +0100, vdm(dot)fbsd(at)virgilio(dot)it wrote:
> Context:FREEBSD 5.4, postgresql 8.0.3
>
> I'm not a C newbye and I'm
> having a go at compiling my first, simple C(++) program:

1. If it's a C program, you should name the file .c otherwise gcc is
likely to consider it a c++ program.

2. If it's a c++ program, use g++ to compile and link to make sure you
get all the right libraries and paths.

3. Use -lpq to link to the postgresql client library. You may need a -L
so it looks in the right place.

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Wijnand Wiersma 2005-09-28 09:44:09 Triggers after a rule
Previous Message ruben 2005-09-28 09:40:11 Re: SQL command to dump the contents of table failed: PQendcopy()