From 77ccb3b64d8e2bccce1b2780ae1b0cca0cc1647b Mon Sep 17 00:00:00 2001 From: Laurenz Albe Date: Mon, 17 Oct 2016 16:44:00 +0200 Subject: [PATCH 2/2] Add instructions for building C functions with MSVC --- doc/src/sgml/dfunc.sgml | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/doc/src/sgml/dfunc.sgml b/doc/src/sgml/dfunc.sgml index 6a4b7d6..8234514 100644 --- a/doc/src/sgml/dfunc.sgml +++ b/doc/src/sgml/dfunc.sgml @@ -205,6 +205,27 @@ gcc -G -o foo.so foo.o + + + Windows with MSVC + Windowsshared library + + + + Windows does not use PIC, so the shared library + has to be linked with the PostgreSQL server's import library + postgres.lib. + The object file will be named foo.obj + and the shared library will be named foo.dll. + The compiler flag to create a shared library is . + +cl /c foo.c +cl /LD /Fe:foo.dll foo.obj postgres.lib + + + + + -- 1.7.1