From: Armel HERVE <ah.pgsql@laposte.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: Custom types for a Windows server
Date: Wed, 21 Dec 2005 11:01:04 +0100
Message-ID: <43A927E0.8090503@laposte.net> (raw)
In-Reply-To: <43A921C1.4050600@laposte.net>
References: <43A921C1.4050600@laposte.net>
Armel HERVE wrote:
> 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
>
In fact, the true command is
gcc -shared -o pstypes.dll -Wl,--library-path=/c/Program\
Files/PostgreSQL/8.1/lib/,-l,pgport,-lpostgres,--out-implib,pstypes.a
country.o
and the response is
Creating library file: pstypes.a
country.o(.text+0x2e):country.c: undefined reference to `elog_start'
country.o(.text+0x49):country.c: undefined reference to `elog_finish'
country.o(.text+0xb0):country.c: undefined reference to
`_imp__CurrentMemoryContext'
country.o(.text+0xba):country.c: undefined reference to `MemoryContextAlloc'
country.o(.text+0xf4):country.c: undefined reference to `elog_start'
country.o(.text+0x10f):country.c: undefined reference to `elog_finish'
country.o(.text+0x13d):country.c: undefined reference to
`_imp__CurrentMemoryContext'
country.o(.text+0x147):country.c: undefined reference to
`MemoryContextAlloc'
country.o(.text+0x1b0):country.c: undefined reference to
`_imp__CurrentMemoryContext'
country.o(.text+0x1ba):country.c: undefined reference to
`MemoryContextAlloc'
country.o(.text+0x205):country.c: undefined reference to `pfree'
country.o(.text+0x241):country.c: undefined reference to
`_imp__CurrentMemoryContext'
country.o(.text+0x24b):country.c: undefined reference to
`MemoryContextAlloc'
country.o(.text+0x280):country.c: undefined reference to `pfree'
country.o(.text+0x2eb):country.c: undefined reference to
`_imp__CurrentMemoryContext'
country.o(.text+0x2f5):country.c: undefined reference to
`MemoryContextAlloc'
country.o(.text+0x33f):country.c: undefined reference to
`_imp__CurrentMemoryContext'
country.o(.text+0x349):country.c: undefined reference to
`MemoryContextAlloc'
collect2: ld returned 1 exit status
I tried to link with all found library with no success...
Armel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: ah.pgsql@laposte.net
Subject: Re: Custom types for a Windows server
In-Reply-To: <43A927E0.8090503@laposte.net>
References: <43A921C1.4050600@laposte.net> <43A927E0.8090503@laposte.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox