deepak <deepak.pn@gmail.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