我想用Python测试Cython。当我运行python setup.py build_ext --compiler=mingw32
(我在Windows上从MSYS2使用GCC)时,它告诉我cannot find -lmsvcr140
(MSVCR140.dll)。从this answer开始,似乎此文件丢失,因为Visual C ++ 2015 Redistributables引入并由VCRuntime140.dll代替。我的问题是如何告诉Cython改用VCRuntime.dll?
答案 0 :(得分:0)
就我而言,我将MinGW更新为MinGW-w64(已证明很关键),
并在cygwinccompiler.py
中编辑代码段:
elif int(msc_ver) >= 1900:
# VS2015 / MSVC 14.0
# return ['msvcr140']
return ['vcruntime140']
然后将vcruntime140.dll
放入/path/to/mingw-w64/lib
,然后解决问题。