X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id EAC529DC823 for ; Wed, 21 Dec 2005 05:55:39 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 89259-03 for ; Wed, 21 Dec 2005 05:55:40 -0400 (AST) X-Greylist: delayed 00:20:37.54597 by SQLgrey- Received: from mx.laposte.net (mx.laposte.net [81.255.54.11]) by postgresql.org (Postfix) with ESMTP id 51F7D9DC80C for ; Wed, 21 Dec 2005 05:55:34 -0400 (AST) Received: from [192.168.2.101] (82.240.84.48) by mx.laposte.net (7.2.060.1) (authenticated as ah.pgsql) id 43839F38013329AE for pgsql-admin@postgresql.org; Wed, 21 Dec 2005 10:35:00 +0100 Message-ID: <43A921C1.4050600@laposte.net> Date: Wed, 21 Dec 2005 10:34:57 +0100 From: Armel HERVE User-Agent: Thunderbird 1.5 (Windows/20051025) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: Custom types for a Windows server Content-Type: multipart/alternative; boundary="------------040709080209030707000406" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=3.772 required=5 tests=[AWL=-0.381, DNS_FROM_SECURITYSAGE=2.001, HTML_MESSAGE=0.001, RCVD_IN_WHOIS_INVALID=2.151] X-Spam-Score: 3.772 X-Spam-Level: *** X-Archive-Number: 200512/236 X-Sequence-Number: 19956 This is a multi-part message in MIME format. --------------040709080209030707000406 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Magnus Hagander wrote: >> we made some custom types (written in C) for PostgreSQL onto >> a Linux server. >> We need to deploy a Windows server... >> >> The documentation does not talk about a shared library for Windows >> (http://www.postgresql.org/docs/8.1/interactive/xfunc-c.html#DFUNC) >> I tried to compile its custom types with borland bcc32, with >> no success: >> >> Does somebody can help me ? >> >> > > You need to compile the functions using MingW GCC. > > //Magnus > > Thanks again for your answers. Now, when I try to generate the shared library by the following command: gcc -shared -o pstypes.dll -Wl,-dy,--library-path,/c/Program\ Files/PostgreSQL/8.1/lib/,-l,libpq.a,--out-implib,pstypes.a country.o the compiler response is: c:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -llibpq.a collect2: ld returned 1 exit status but the libpq.a is in the lib repository of PostgresSQL... I tried to link with the libpq.dll located in the bin repository, the response is the same: cannot find -llibpq.dll Armel --------------040709080209030707000406 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
Magnus Hagander wrote:
we made some custom types (written in C)  for PostgreSQL onto 
a Linux server.
We need to deploy a Windows server...

The documentation does not talk about a shared library for Windows
(http://www.postgresql.org/docs/8.1/interactive/xfunc-c.html#DFUNC)
I tried to compile its custom types with borland bcc32, with 
no success:

Does somebody can help me ?

    

You need to compile the functions using MingW GCC.

//Magnus

  
Thanks again for your answers.
Now, when I try to generate the shared library by the following command:
gcc -shared -o pstypes.dll -Wl,-dy,--library-path,/c/Program\ Files/PostgreSQL/8.1/lib/,-l,libpq.a,--out-implib,pstypes.a country.o

the compiler response is:
c:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -llibpq.a
collect2: ld returned 1 exit status

but the libpq.a is in the lib repository of PostgresSQL...

I tried to link with the libpq.dll located in the bin repository, the response is the same: cannot find -llibpq.dll

Armel

--------------040709080209030707000406--