Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id CAA87635136 for ; Mon, 6 Apr 2009 10:46:23 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 64625-06 for ; Mon, 6 Apr 2009 10:46:13 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from blu0-omc2-s21.blu0.hotmail.com (blu0-omc2-s21.blu0.hotmail.com [65.55.111.96]) by mail.postgresql.org (Postfix) with ESMTP id E46D963511B for ; Mon, 6 Apr 2009 10:46:21 -0300 (ADT) Received: from BLU133-W33 ([65.55.111.71]) by blu0-omc2-s21.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 6 Apr 2009 06:46:20 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_e6b633a3-ac83-4b0c-bec2-db8f7272ee1e_" X-Originating-IP: [131.173.79.102] From: eehab hamzeh To: Subject: compiling c function using MinGW Date: Mon, 6 Apr 2009 13:46:19 +0000 Importance: Normal In-Reply-To: References: MIME-Version: 1.0 X-OriginalArrivalTime: 06 Apr 2009 13:46:20.0177 (UTC) FILETIME=[10FC2010:01C9B6BE] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.52 tagged_above=0 required=5 tests=HTML_IMAGE_ONLY_28=1.519, HTML_MESSAGE=0.001 X-Spam-Level: * X-Archive-Number: 200904/187 X-Sequence-Number: 146143 --_e6b633a3-ac83-4b0c-bec2-db8f7272ee1e_ Content-Type: text/plain; charset="windows-1255" Content-Transfer-Encoding: 8bit this is how i write the command in MinGW any more direction about I. I am a new user for MinGW gcc -shared -o hamzeh.dll tt1.o -L "c:/programme/postgresql/8.3/lib" -lpostgres Thanks Ihab > > 2009/4/6 eehab hamzeh : > > Hello > > > > I am trying to build some functions using C language. these functions are > > mentioned in the postgresql documentation. > > > > http://www.postgresql.org/docs/8.3/interactive/xfunc-c.html > > > > Datum > > add_one_float8(PG_FUNCTION_ARGS) > > { > > /* The macros for FLOAT8 hide its pass-by-reference nature. */ > > float8 arg = PG_GETARG_FLOAT8(0); > > > > PG_RETURN_FLOAT8(arg + 1.0); > > } > > > > PG_FUNCTION_INFO_V1(makepoint); > > > > Datum > > makepoint(PG_FUNCTION_ARGS) > > { > > /* Here, the pass-by-reference nature of Point is not hidden. */ > > Point *pointx = PG_GETARG_POINT_P(0); > > Point *pointy = PG_GETARG_POINT_P(1); > > Point *new_point = (Point *) palloc(sizeof(Point)); > > > > new_point->x = pointx->x; > > new_point->y = pointy->y; > > > > PG_RETURN_POINT_P(new_ > > point); > > } > > > > the only function that are work are the one with int32 variable. > > the other function bring errors and are not working > > any body can give directions > > > > > > kind regards > > ihab > > Re-send to pgsql-general. > > Can you paste these errors and how you're compiling this? > > -- > Emanuel Calvo Franco > Sumate al ARPUG ! > (www.postgres-arg.org - > www.arpug.com.ar) > ArPUG / AOSUG Member > Postgresql Support & Admin _________________________________________________________________ Show them the way! Add maps and directions to your party invites. http://www.microsoft.com/windows/windowslive/products/events.aspx --_e6b633a3-ac83-4b0c-bec2-db8f7272ee1e_ Content-Type: text/html; charset="windows-1255" Content-Transfer-Encoding: 8bit this is how i write the command in MinGW any more direction about I. I am a new user for MinGW
gcc -shared -o hamzeh.dll tt1.o -L "c:/programme/postgresql/8.3/lib" -lpostgres

Thanks

Ihab



>
> 2009/4/6 eehab hamzeh <eehab40@hotmail.com>:
> >     Hello
> >
> > I am trying to build some functions using C language. these functions are
> > mentioned in the postgresql documentation.
> >
> > http://www.postgresql.org/docs/8.3/interactive/xfunc-c.html
> >
> > Datum
> > add_one_float8(PG_FUNCTION_ARGS)
> > {
> > /* The macros for FLOAT8 hide its pass-by-reference nature. */
> > float8 arg = PG_GETARG_FLOAT8(0);
> >
> > PG_RETURN_FLOAT8(arg + 1.0);
> > }
> >
> > PG_FUNCTION_INFO_V1(makepoint);
> >
&g t; > Datum
> > makepoint(PG_FUNCTION_ARGS)
> > {
> > /* Here, the pass-by-reference nature of Point is not hidden. */
> > Point *pointx = PG_GETARG_POINT_P(0);
> > Point *pointy = PG_GETARG_POINT_P(1);
> > Point *new_point = (Point *) palloc(sizeof(Point));
> >
> > new_point->x = pointx->x;
> > new_point->y = pointy->y;
> >
> > PG_RETURN_POINT_P(new_
> > point);
> > }
> >
> > the only function that are work are the one with int32 variable.
> > the other function bring errors and are not working
> > any body can give directions
> >
> >
> > kind regards
> > ihab
>
> Re-send to pgsql-general.
>
> Can you paste these errors and how you're compiling this?
>
> --
> Emanuel Calvo Franco
> Sumate al ARPUG !
> (www.postgres-arg.org -
> www.arpug.com.ar)
> ArPUG / AOSUG Member
> Postgresql Support & Admin


See all the ways you can stay connected to friends and family --_e6b633a3-ac83-4b0c-bec2-db8f7272ee1e_--