1

files:

D:\Program Files (x86)\Microsoft Visual Studio 9.0

D:\Program Files (x86)\Microsoft Visual Studio 9.0\boost_1_50_0

D:\Program Files (x86)\Microsoft Visual Studio 9.0\QuantLib-1.2

D:\Program Files (x86)\Microsoft Visual Studio 9.0\QuantLib-SWIG-1.2

D:\Program Files (x86)\Microsoft Visual Studio 9.0\swigwin-2.0.7

D:\Python27

while I strictly following the method which descripted in http://quantcodetips.blogspot.com/2012_02_01_archive.html, after set in visual studio 2008 command prompt

set INCLUDE=D:\Program Files (x86)\Microsoft Visual Studio 9.0\boost_1_50_0

set QL_DIR=D:\Program Files (x86)\Microsoft Visual Studio 9.0\QuantLib-1.2

set LIB=D:\Program Files (x86)\Microsoft Visual Studio 9.0\QuantLib-1.2\ql\Release\;
D:\Program Files (x86)\Microsoft Visual Studio 9.0\boost_1_50_0\stage\lib\

and change the name QuantLib-boost1.50-msvc9.obj (D:\Program Files (x86)\Microsoft Visual Studio 9.0\QuantLib-1.2\ql\Release) to QuantLib-vc90-mt.obj;

then go to QuantLib-SWIG-1.2, using

 python setup.py build --compiler=msvc

a link error appearing.

D:\Program Files (x86)\Microsoft Visual Studio 9.0\QuantLib-1.2\ql/time/calendar
s/argentina.hpp : warning C4819: The file contains a character that cannot be re
presented in the current code page (936). Save the file in Unicode format to pre
vent data loss

D:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo
/INCREMENTAL:NO /LIBPATH:D:\Python27\libs /LIBPATH:D:\Python27\PCbuild "/LIBPATH
:D:\Program Files (x86)\Microsoft Visual Studio 9.0\QuantLib-1.2\lib" "/LIBPATH:
D:\Program Files (x86)\Microsoft Visual Studio 9.0\QuantLib-1.2\ql\Release\" "/L
IBPATH:D:\Program Files (x86)\Microsoft Visual Studio 9.0\boost_1_50_0\stage\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\Re
lease\QuantLib\_QuantLib.lib /MANIFESTFILE:build\temp.win32-2.7\Release\QuantLib
\_QuantLib.pyd.manifest /subsystem:windows /machine:I386

LINK : fatal error LNK1181: cannot open input file 'Files.obj'
error: command '"D:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.
exe"' failed with exit status 1181

Look for help.

coolahao
  • 25
  • 6

1 Answers1

0

The Python distutils module (used for building the wrappers) has problems with spaces in the path names. Move the QuantLib and Boost folders out of C:\Program Files, change the INCLUDE, QL_DIR and LIB variables accordingly, and retry.

On a side note, I read the instructions at the link you cited, and I wouldn't follow them too strictly. For instance, you can use the provided VC++2008 solution file (QuantLib_vc9.sln) instead of creating a new project yourself. This will also avoid the need of renaming the library, as it will create it with the correct name to begin with, and will make it unnecessary to delete stuff from the distribution (which is there for a reason). But if you're all set up, this can wait.

Luigi Ballabio
  • 4,128
  • 21
  • 29