带有python扩展名的VS2015链接器错误

带有python扩展名的VS2015链接器错误,python,c,zlib,Python,C,Zlib,我正试图构建我自己的python(3.5.2)c扩展,它依赖于zlib。在linux上使用gcc,它可以完美地工作,但我似乎无法使它在windows 64位上工作 我按照说明安装了zlib dll: Installing ZLIB1.DLL ==================== Copy ZLIB1.DLL to the SYSTEM or the SYSTEM32 directory. Using ZLIB1.DLL with Microsoft Visual C++ ======

我正试图构建我自己的python(3.5.2)c扩展,它依赖于zlib。在linux上使用gcc,它可以完美地工作,但我似乎无法使它在windows 64位上工作

我按照说明安装了zlib dll:

Installing ZLIB1.DLL
====================
  Copy ZLIB1.DLL to the SYSTEM or the SYSTEM32 directory.


Using ZLIB1.DLL with Microsoft Visual C++
=========================================
   1. Install the supplied header files "zlib.h" and "zconf.h"
      into a directory found in the INCLUDE path list.

   2. Install the supplied library file "zdll.lib" into a
      directory found in the LIB path list.

   3. Add "zdll.lib" to your project.
My setup.py:

from setuptools import setup, Extension
from Cython.Build import cythonize

setup(
    ext_modules=cythonize([Extension("esp", ["bethlib/esp.pyx", "bethlib/c_esp.c", "bethlib/linked_list.c"], libraries=["zdll"], include_dirs=["include"], library_dirs=["lib"])]),
)
尝试使用
python setup.py bdist\u wheel构建时出现错误:

c_esp.obj : error LNK2001: unresolved external symbol uncompress
build\lib.win-amd64-3.5\esp.cp35-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals
error: command 'E:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1120

uncompress
是zlib.h中存在的有效函数。有什么解决办法吗?谢谢

我从下载了静态zlib库,它可以正常工作。这是一个较旧的版本,所以如果我能得到一个更新的版本,我仍然会很感激,但现在已经足够了。

我从下载了静态zlib库,它可以正常工作。它是为旧版本,所以我仍然赞赏如果我可以得到一个更当前的版本,但现在已经足够了。

在Windows上,你必须用同一版本的VS构建你的扩展,用来构建Python解释器,大概是代码> ZLIB。DLL< /Cal> >(或者可选地使用GCC)。是的,VS2015(Visual C++编译器14)已使用,zlib建议使用我按照说明安装的zlib1.dll。您是否确保zlib是x64版本?您可以检查dll中的实际内容。看看你是否需要一个64位Windows版本的
zlib
,听起来你需要构建它(看起来像是他们的版本)。在Windows上,你必须使用与构建Python解释器相同的VS版本构建扩展,可能是
zlib.dll
(或者使用gcc)。是的,VS2015使用了VisualC++编译器14,ZLIB推荐了ZLB1.DLL,我是根据这些配置安装的。您确定ZLIB是X64版本吗?您可能能够检查DLL中的实际内容。如果您需要64位Windows版本的<代码> ZLIB < /C>,听起来您需要构建它(看起来像是版本)。