- These are step-by-step instructions to install QuantLib and Boost on the Microsoft Visual C++ 2012 IDE
- These instructions are for MS Visual C++ 2012 only. If you have earlier versions of this IDE (2008, 2005...) then have a look at this page.
- Before using QuantLib you need to install the Boost library on your computer. Iinstructions om how to get Boost library follow in the next section.
- The Boost library can be downloaded here. Currently, the latest version available is Boost 1.52.0.
- You can build boost by following the instruction here.
- Alternative you can download a pre-built lib from here. Once downloaded, copy the installer into the Boost 1.52.0 folder and run it. Rename the folder to lib once done.
- Download QuantLib 1.2.1 compatible with VS 2012 from this page. With Boost 1.52.0 and QuantLib 1.2.1 installed , you can set the VC++ directories as follows.
- Open the solution file named QuantLib_vc11.sln ( …\QuantLib-1.2.1\ QuantLib_vc11.sln). This will open the 15 projects contained in the solution (see the picture, below).
- Open the Property Manager window, (see View menu, Other Windows, Property Manager), locate the Microsoft.Cpp.Win32.user property sheet.
- Select Microsoft.Cpp.Win32.user property sheet as shown above, right click it and select Properties.
- Add the folder … \boost_1_52 to Configuration Properties/VC++ Directories/Include Directories. Then, add the path to the folder … \boost_1_52\lib to Configuration Properties/VC++ Directories/Libraries Directories (see picture below).
- Click ok to apply changes.
- Switch back to the Solutions Explorer, right-click on the solution icon and choose Build Solution to build all projects in the Release mode. Besides QuantLib, this will build the examples and run the test suite.
- After finishing, the output should show no errors and look like below:
- You are done with building QuantLib. If you want, you can build the Debug version in the same way by choosing Debug from the configuration menu as shown below. This will allow you to debug your application later.
- To test QuantLib with the example here, go to VC++ Directories. You can see that the Boost folders are already there, so you don't have to do anything to configure them. Add the QuantLib path (….\QuantLib) to the include directories.
- Finally, you can add the QuantLib library path (….\QuantLib\lib) to the library directories, or you can go to Configuration Properties/Linker/Generaland add it to Additional Library Directories. Click OK.
- For more information refer to this link where I got most of the information for this tutorial -- Quantcorner.