python - Quantlib 1.14 和 Quantlib1.14-SWIG : versions of Visual C++ prior to VC++10 (2010) are no longer supported

标签 python c++ quantlib quantlib-swig

我为 quantlib 1.14 和 quantlib 1.14-swig 下载了 tarbals。 SWIG 下的 quantlib 文件夹确实包含 quantlib_wrap.cpp。但是安装程序提示 MSC 版本。这是新的错误。这篇文章与 another post 有关关于缺少 quantlib_wrap.cpp 错误消息。

C:\Users\Public\3rdParty\Libraries\QuantLib-1.14\ql/config.msvc.hpp(29) : fatal error C1189: #error :  "versions of Visual C++ prior to VC++10 (2010) are no longer supported"
error: command 'C:\\Users\\U435169\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2.

使用 1.13。不再支持 VC9。 – 路易吉·巴拉比奥

我也会尝试 1.13。但实际上,我确实安装了 VC++ 14.0。我正在使用 VS2015 来编译 quantlib。不确定真正的原因。

我确实尝试了 1.13 并遇到了链接错误。我认为这可能是由于 quantlib-swig (VC9.0) 和 quantlib(VC14) 的编译不一致造成的。如果是这样,我们如何控制 quantlib-swig 的编译版本?有控制它的选项吗?

C:\Users\U435169\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX -ID:\packages\Python27\include -ID:\packages\Python27\PC -IC:\Users\Public\3rdParty\Libraries\QuantLib-1.13 -IC:\Users\Public\MSYS2\mingw32\include /TpQuantLib/quantlib_wrap.cpp /Fobuild\temp.win32-2.7\Release\QuantLib/quantlib_wrap.obj /GR /FD /Zm250 /EHsc /bigobj /MD
quantlib_wrap.cpp
C:\Users\U435169\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:D:\packages\Python27\libs /LIBPATH:D:\packages\Python27\PCbuild /LIBPATH:D:\packages\Python27\PC\VS9.0 /LIBPATH:C:\Users\Public\3rdParty\Libraries\QuantLib-1.13\lib /EXPORT:init_QuantLib build\temp.win32-2.7\Release\QuantLib/quantlib_wrap.obj /OUT:build\lib.win32-2.7\QuantLib\_QuantLib.pyd /IMPLIB:build\temp.win32-2.7\Release\QuantLib\_QuantLib.lib /MANIFESTFILE:build\temp.win32-2.7\Release\QuantLib\_QuantLib.pyd.manifest /subsystem:windows /machine:x86
LINK : fatal error LNK1104: cannot open file 'QuantLib-vc90-mt.lib'
error: command 'C:\\Users\\U435169\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\link.exe' failed with exit status 1104

最佳答案

我猜您正在为 Python 2.7 编译模块?

Windows 版 Python 2.7 使用 VC++ 2008 编译,并使用它来编译外部模块。如果您可以改用 Python 3.5 或更高版本,它将使用您的 VC++ 2015 安装。

关于python - Quantlib 1.14 和 Quantlib1.14-SWIG : versions of Visual C++ prior to VC++10 (2010) are no longer supported,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53400935/

相关文章:

c++ - 难以置信的快速 C++ 委托(delegate)和不同的翻译单元

c++ - 无法链接到 quantlib

python - 向字典键添加值

Python traceback.print_exc() 返回 'None'

python - 不断重绘wxPython元素

python - 并行训练多个不同的 sklearn 模型

c++ - 如何在 C++ 中访问新主函数的参数?

c++ - Visual Studio - 查找导致 C1905(处理器不兼容)的模块

python - 在没有 pip 的情况下在 virtualenv 中安装包

python - 将 QuantLib 导入为 ql 错误