Re: Problems adding C Extentions - Mailing list pgsql-cygwin

From DDonnelly@rochgrp.com
Subject Re: Problems adding C Extentions
Date
Msg-id 904D0CA3F6F98441BB3D7703189859940DD693@trgmsg.rochgrp.com
Whole thread Raw
In response to Problems adding C Extentions  (DDonnelly@rochgrp.com)
List pgsql-cygwin
I'm not sure where to add that directive.  We use the standard configure and
make to build postgres for the cygwin environment and that seems to work
fine.  For our C code we have one c module and on linux build it with the
following command :

PGINCLUDEPATH="-I `pg_config --includedir` -I
/usr/src/postgresql-7.3-1/src/include"
PGLIBPATH="-L `pg_config --libdir` -L /usr/src/postgresql-7.3-1/src/backend"

LIBNAME=`echo $1 | sed 's/\.c/.so/'`
OBJNAME=`echo $1 | sed 's/\.c/\.o/'`

LIBS="-lpostgres -lc"

echo 'This is pgcc...'

echo "gcc $PGINCLUDE -c $1"
gcc $PGINCLUDEPATH -c $1

ld -shared -o $LIBNAME $OBJNAME $PGLIBPATH $LIBS

Any more help you could provide me would be greatly appreciated.


-----Original Message-----
From: Norman Vine [mailto:nhv@cape.com]
Sent: Wednesday, January 29, 2003 12:33 AM
To: Donnelly, Dan; pgsql-cygwin@postgresql.org
Subject: Re: [CYGWIN] Problems adding C Extentions


DDonnelly@rochgrp.com writes:

> I am moving a Postgres application from Linux to Cygwin.  The application
> has some Postgres extensions built in C.  I get a clean compile and load,
> but when I go to load the functions into Postgres I get a load error.  I
> would appreciate any guidance.  Here is the code and error message:
>
> create function RealPct(int4, int4) returns float8
>         as '/home/ddonn/stc/model/stcdemo/STCModel.so' language 'c'
> with(isStrict);
> ERROR:  Load of file /home/ddonn/stc/model/stcdemo/STCModel.so failed:
> dlopen: Win32 error 3221225622

Make sure you have the following in your Makefile

override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)


HTH

Norman

pgsql-cygwin by date:

Previous
From: Jason Tishler
Date:
Subject: Re: Plperl, createlang fails
Next
From: "Cheah Ai Meng"
Date:
Subject: Initializing PostgreSQL falied