I'm creating user-defined server extensions, written in C per the manual "31.9. C-Language Functions". Everything
workswell, but only if I fully link the .so such that there are *no* unresolved external references at all. Not even
thestuff in libstdc++.a can be left out. I've tried setting LD_LIBRARY_PATH everywhere possible, with no luck. Here's
themake(1) line I have to use to link:
libmyfuncs.so.0.0:gcc -Wall -Wmissing-prototypes -Wpointer-arith \ -Wdeclaration-after-statement
-Wold-style-definition-Wendif-labels \ -fno-strict-aliasing -fpic -shared -Wl,-soname,libmyfuncs.so.0 \ $(OBJS) \
$(MYLIB)/lib/libmylibs.a\ /usr/lib/gcc/i386-redhat-linux/3.4.2/libstdc++.a \ -o libmyfuncs.so.0.0
Is this correct? Do Postgres extension need to be fully statically linked? Or is there some configuration that will
specifyLD_LIBRARY_PATH (or perhaps a Postgres-specific equivalent).
The manual's instructions are good regarding writing code, but don't say much about linking.
Thanks,
Craig