Re: Building extensions on Windows using VS2008

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: deepak <deepak(dot)pn(at)gmail(dot)com>
Cc: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>, pgsql-general(at)postgresql(dot)org
Subject: Re: Building extensions on Windows using VS2008
Date: 2011-02-20 15:44:31
Message-ID: 29143.1298216671@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

deepak <deepak(dot)pn(at)gmail(dot)com> writes:
> Here's the trimmed down version of the source and the Makefile (copied and
> modified from the 'cube' contrib project)
> (with which I see the error related to redefinition)

> /* myext.c */

> #include <string.h>
> #include <math.h>
> #include "postgres.h"
> #include "fmgr.h"

As was noted upthread, this ordering is pretty unsafe. postgres.h
should always be included *first* in any C file that's meant to run in
the backend environment. There are platforms in which failing to do so
causes crashes because of 32-vs-64-bit issues. Not sure if this
explains your Windows issue too, but in any case the above is wrong.

> myext.o: myext.c

> clean:
> rm -f myext.o

BTW, these rules are unnecessary --- having listed myext.o in OBJS is
sufficient.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Reuven M. Lerner 2011-02-20 16:35:31 Re: Questions about octal vs. hex for bytea
Previous Message Tom Lane 2011-02-20 15:38:05 Re: Questions about octal vs. hex for bytea