To use QuantLib classes in your own code just add #include <ql/quantlib.hpp>
at the beginning of your source/header files. Depending on the number of your files in your project, this could cause a large increase in compilation time. If this were not acceptable, collective headers are also available for smaller parts of the library; in particular, each subdirectory of the ql directory contains a file all.hpp which makes available all classes and function in the respective subdirectory.
Under the Examples folder you can find examples of QuantLib usage, including input files for automake and makefiles for the Borland free compiler and Microsoft Visual C++. For the latter, project files are also available.
A few suggestions for Visual C++ users wanting to use QuantLib into their own application:
- you won't have to explicitly link your application to the QuantLib library. This is done automatically by compiler directives embedded in the sources.
- Your project must be compiled with the same options that were used in compiling the QuantLib library, in particular with regard to the settings under project settings, "C/C++" tab, "Code Generation". You'll have to check the "Use RTTI" option under the "C++ Language" category, too. Finally, you have to define the NOMINMAX macro.
|