0

hi i am trying to install quantlib for python with SWIG bindings, and I get the following error. I am on Windows 7, have Python 2.7 64 bit and built quantlib 1.5 with MS Visual Studio Express 2008 where I had performed all the steps outlined in https://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/ to compile 64 bit code:

running build
running build_py
copying QuantLib\QuantLib.py -> build\lib.win-amd64-2.7\QuantLib
running build_ext
building 'QuantLib._QuantLib' extension
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX -IC:\Anaconda1\include -IC:\Anaconda1\PC -IC:\Users\nick11\Documents\software\QuantLib-1.5 -IC:\Boost\boost_1_57_0 /TpQuantLib/quantlib_wrap.cpp /Fobuild\temp.win-amd64-2.7\Release\QuantLib/quantlib_wrap.obj /GR /FD /Zm250 /EHsc /MD
quantlib_wrap.cpp
C:\Boost\boost_1_57_0\boost/type_index.hpp(37) : warning C4068: unknown pragma
QuantLib/quantlib_wrap.cpp(13920) : warning C4018: '<' : signed/unsigned mismatch
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Anaconda1\libs /LIBPATH:C:\Anaconda1\PCbuild\amd64 /LIBPATH:C:\Users\stathis1\Documents\software\QuantLib-1.5\lib /LIBPATH:C:\Boost\boost_1_57_0\libs /LIBPATH:C:\Users\nick1\Documents\software\QuantLib-1.5\lib /EXPORT:init_QuantLib build\temp.win-amd64-2.7\Release\QuantLib/quantlib_wrap.obj /OUT:build\lib.win-amd64-2.7\QuantLib\_QuantLib.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\QuantLib\_QuantLib.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\QuantLib\_QuantLib.pyd.manifest /subsystem:windows /machine:I386
python27.lib(python27.dll) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
NickD1
  • 393
  • 1
  • 4
  • 14

1 Answers1

1

Seems you want to build a version for 32-Bit Python but you have active the 64_Bit Toolchain of Visual Studio.

The solution might be to enable the Visual Studio 32-Bit Toolchain before starting the build of the quantlib python library.

Have a look on the appropriate documentation on the msdn pages:

https://msdn.microsoft.com/en-us/library/x4d2c09s%28v=vs.90%29.aspx

Can not test it myself because i have no visual studio 2008 installed. But i have had the same problem with VS2015 when i tried to build for 64-Bit python with the 32-bit toolchain.

Volker
  • 11
  • 1