From 75b935fd31a19c84b001332b6c008fd1bbed0cc5 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Tue, 29 Jun 2021 12:47:43 +0100 Subject: [PATCH] Add ws2_32 lib dependency on Windows --- psycopg_c/setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/psycopg_c/setup.py b/psycopg_c/setup.py index fed83b2bd..fb3163b84 100644 --- a/psycopg_c/setup.py +++ b/psycopg_c/setup.py @@ -64,6 +64,10 @@ class psycopg_build_ext(build_ext): if path: ext.library_dirs.append(path) + if sys.platform == "win32": + # For __imp_htons and others + ext.libraries.append("ws2_32") + if cythonize is not None: for ext in self.distribution.ext_modules: for i in range(len(ext.sources)): -- 2.47.3