Обсуждение: link errors building extensions for Postgres on Windows using MinGW
I'm trying to port an extension that previously ran under Postgres on linux so that it runs under PostgreSQL 8.0.3 on Windows. I'm using MingGW for the compiling/linking.
I'm getting problems when I try to link though. Symbols that are defined in the Postgres server and referenced in my extension cause link errors that prevent a dll from being produced.
gcc -u_etext -shared -fpic -Wl,--whole-archive -o destDir/Grid.dll -Lmylibdir -L/lib -L/c/Program\ Files/PostgreSQL/8.0/lib -lmylibs -Wl,--no-whole-archive -lpostgres -lwsock32 -lm 2> link.errs
can anyone suggest a solution?
Thank you,
I'm getting problems when I try to link though. Symbols that are defined in the Postgres server and referenced in my extension cause link errors that prevent a dll from being produced.
- fe-giefToGrid.c:25: undefined reference to `pg_detoast_datum'
- fe-udr.c:510: undefined reference to `Float8GetDatum'
- libgridfrontendDEBUG.a(fe-udr.o)(.text+0xbe7):fe-udr.c:515: undefined reference to `get_typlenbyvalalign'
- fe-udr.c:510: undefined reference to `Float8GetDatum'
gcc -u_etext -shared -fpic -Wl,--whole-archive -o destDir/Grid.dll -Lmylibdir -L/lib -L/c/Program\ Files/PostgreSQL/8.0/lib -lmylibs -Wl,--no-whole-archive -lpostgres -lwsock32 -lm 2> link.errs
can anyone suggest a solution?
Thank you,
**********************************************
Eric Davies, M.Sc.
Barrodale Computing Services Ltd.
Tel: (250) 472-4372 Fax: (250) 472-4373
Web: http://www.barrodale.com
Email: eric@barrodale.com
**********************************************
Mailing Address:
P.O. Box 3075 STN CSC
Victoria BC Canada V8W 3W2
Shipping Address:
Hut R, McKenzie Avenue
University of Victoria
Victoria BC Canada V8W 3W2
**********************************************