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.
- 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'
I can get rid of these link errors by linking in the libpostgres.a file at the cost of a much larger shared library. In theory, I shouldn't need to though (at least I don't under linux), and doing so may result in two inconsistent copies of some Postgres internal data structures presumably. My link line looks like:
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
**********************************************