【发布时间】:2019-09-30 19:44:38
【问题描述】:
我正在尝试将我的 python 模块从 .py 转换为 .pyd dll。
每次我尝试执行我的设置脚本时。
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [
Extension("core", ["core.py"]),
]
setup(
name = 'core',
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules
)
我收到此错误:
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: cannot find -lvcruntime140.dll
collect2.exe: error: ld returned 1 exit status
error: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1
【问题讨论】:
-
这是一个 VStudio 2015 库。如果您打算将它与 Win Python 一起使用,您应该安装它并使用它来构建 pyd。 stackoverflow.com/questions/45340527/….
-
顺便说一句,正如它所说,该错误来自
ld- 链接器 gcc 在完成创建目标文件后启动 - 而不是 gcc 本身。