0
zlibに依存する独自のpython(3.5.2)c拡張をビルドしようとしています。 Linux上でgccを使用すると完全に動作しますが、Windows 64ビット版では動作しないようです。VS2015のPython拡張機能でリンカーエラーが発生しました
私は指示に従って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.
私のsetup.py:python setup.py bdist_wheel
を構築しようとする
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"])]),
)
はエラーを与える:
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にあります。どんな解決策ですか?ありがとう!
Windowsでは、Pythonインタプリタとおそらく 'zlib.dll'をビルドするのに使われたのと同じバージョンのVSで拡張機能をビルドする必要があります(あるいはgccを使います)。 – martineau
はい、VS2015(Visual C++コンパイラ14.0)が使用されましたが、zlibはインプリメンテーションごとにインストールしたzlib1.dllをお勧めします –
zlibがx64バージョンであることを確認しましたか? – refi64