pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedCustom types for a Windows server
4+ messages / 2 participants
[nested] [flat]
* Custom types for a Windows server
@ 2005-12-20 11:18 Armel HERVE <ah.pgsql@laposte.net>
0 siblings, 0 replies; 4+ messages in thread
From: Armel HERVE @ 2005-12-20 11:18 UTC (permalink / raw)
To: pgsql-admin
Hi there,
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 ?
Thanks
Armel (who writes English very bad...)
D:\tmp>bcc32 -I"c:\Program Files\PostgreSQL\8.1\include\server"
-Ic:\Borland\BCC55\Include -I"c:\Program Files\PostgreSQ
L\8.1\include" country.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
country.c:
Warning W8017 c:\Program
Files\PostgreSQL\8.1\include\server\pg_config_os.h 145: Redefinition of
'SIGUSR1' is not identi
cal
Warning W8017 c:\Program
Files\PostgreSQL\8.1\include\server\pg_config_os.h 146: Redefinition of
'SIGUSR2' is not identi
cal
Error E2147 c:\Program
Files\PostgreSQL\8.1\include\server\pg_config_os.h 225: 'pid_t' cannot
start a parameter declarat
ion
Error E2209 c:\Program Files\PostgreSQL\8.1\include\server\c.h 70:
Unable to open include file 'strings.h'
Error E2238 c:\Program
Files\PostgreSQL\8.1\include\server\pg_config_os.h 79: Multiple
declaration for 'shmid_ds'
Error E2344 c:\Program
Files\PostgreSQL\8.1\include\server\pg_config_os.h 78: Earlier
declaration of 'shmid_ds'
Error E2238 c:\Program
Files\PostgreSQL\8.1\include\server\pg_config_os.h 94: Multiple
declaration for 'semun'
Error E2344 c:\Program
Files\PostgreSQL\8.1\include\server\pg_config_os.h 93: Earlier
declaration of 'semun'
Error E2238 c:\Program
Files\PostgreSQL\8.1\include\server\pg_config_os.h 101: Multiple
declaration for 'sembuf'
Error E2344 c:\Program
Files\PostgreSQL\8.1\include\server\pg_config_os.h 100: Earlier
declaration of 'sembuf'
Error E2238 c:\Program
Files\PostgreSQL\8.1\include\server\pg_config_os.h 149: Multiple
declaration for 'timezone'
Error E2344 c:\Program
Files\PostgreSQL\8.1\include\server\pg_config_os.h 148: Earlier
declaration of 'timezone'
Error E2238 c:\Program
Files\PostgreSQL\8.1\include\server\pg_config_os.h 157: Multiple
declaration for 'itimerval'
Error E2344 c:\Program
Files\PostgreSQL\8.1\include\server\pg_config_os.h 156: Earlier
declaration of 'itimerval'
Error E2147 c:\Program
Files\PostgreSQL\8.1\include\server\pg_config_os.h 225: 'pid_t' cannot
start a parameter declarat
ion
Error E2209 c:\Program Files\PostgreSQL\8.1\include\server\c.h 98:
Unable to open include file 'libintl.h'
Error E2176 c:\Program Files\PostgreSQL\8.1\include\server\c.h 291: Too
many types in declaration
Error E2176 c:\Program Files\PostgreSQL\8.1\include\server\c.h 294: Too
many types in declaration
Error E2209 c:\Program Files\PostgreSQL\8.1\include\server\port.h 16:
Unable to open include file 'pwd.h'
Error E2209 c:\Program Files\PostgreSQL\8.1\include\server\port.h 17:
Unable to open include file 'netdb.h'
Error E2221 c:\Program Files\PostgreSQL\8.1\include\server\port.h 252:
Macro argument syntax error
Error E2209 c:\Program Files\PostgreSQL\8.1\include\server\port.h 307:
Unable to open include file 'netinet/in.h'
Error E2209 c:\Program Files\PostgreSQL\8.1\include\server\port.h 308:
Unable to open include file 'arpa/inet.h'
Error E2040 c:\Program Files\PostgreSQL\8.1\include\server\port.h 318:
Declaration terminated incorrectly
Error E2451 country.c 267: Undefined symbol '__func__' in function
country_in
Error E2140 country.c 271: Declaration is not allowed here in function
country_in
Error E2140 country.c 272: Declaration is not allowed here in function
country_in
Error E2228 country.c 272: Too many error or warning messages in
function country_in
*** 26 errors in Compile ***
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Custom types for a Windows server
@ 2005-12-20 12:42 Magnus Hagander <mha@sollentuna.net>
0 siblings, 0 replies; 4+ messages in thread
From: Magnus Hagander @ 2005-12-20 12:42 UTC (permalink / raw)
To: Armel HERVE <ah.pgsql@laposte.net>; pgsql-admin
> 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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Custom types for a Windows server
@ 2005-12-21 09:34 Armel HERVE <ah.pgsql@laposte.net>
2005-12-21 10:01 ` Re: Custom types for a Windows server Armel HERVE <ah.pgsql@laposte.net>
0 siblings, 1 reply; 4+ messages in thread
From: Armel HERVE @ 2005-12-21 09:34 UTC (permalink / raw)
To: pgsql-admin
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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Custom types for a Windows server
2005-12-21 09:34 Re: Custom types for a Windows server Armel HERVE <ah.pgsql@laposte.net>
@ 2005-12-21 10:01 ` Armel HERVE <ah.pgsql@laposte.net>
0 siblings, 0 replies; 4+ messages in thread
From: Armel HERVE @ 2005-12-21 10:01 UTC (permalink / raw)
To: ; +Cc: pgsql-admin
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
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2005-12-21 10:01 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-12-20 11:18 Custom types for a Windows server Armel HERVE <ah.pgsql@laposte.net>
2005-12-20 12:42 Re: Custom types for a Windows server Magnus Hagander <mha@sollentuna.net>
2005-12-21 09:34 Re: Custom types for a Windows server Armel HERVE <ah.pgsql@laposte.net>
2005-12-21 10:01 ` Armel HERVE <ah.pgsql@laposte.net>
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