VS2015 linker error with python extension
<p>I'm trying to build my own python (3.5.2) c extension that depends on zlib. With gcc on linux it works perfectly but I can't seem to make it work on windows 64-bit.</p>

<p>I installed zlib dll according to the instructions:</p>

<pre><code>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.
</code></pre>

<p>My setup.py:</p>

<pre><code>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"])]),
)
</code></pre>

<p>Trying to build with <code>python setup.py bdist_wheel</code> gives the error:</p>

<pre><code>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
</code></pre>

<p><code>uncompress</code> is a valid function present in zlib.h. Any solutions? Thanks!</p>

<p>I downloaded the static zlib lib from <a href="http://www.winimage.com/zLibDll/index.html" rel="nofollow">this website</a> and it works. It's for an older version so I'd still appreciate if I could get a more current version but for now it's enough.</p>

python c zlib