Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) QuantLib GetQuantLibVersion

 

GetQuantLibVersion is a version code snippets to obtain the version of the current QuantLib library.

 

 

 

 

 

Technical facts

 

Application type(s)

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: CppGetQuantLibVersion.pro

 

#-------------------------------------------------
#
# Project created by QtCreator 2011-06-26T09:25:02
#
#-------------------------------------------------
QT       += core
QT       -= gui
LIBS += -L/opt/local/lib -lQuantLib
INCLUDEPATH += /opt/local/include/ -opt/local/include/boost
TARGET = CppGetQuantLibVersion
CONFIG   += console
CONFIG   -= app_bundle
TEMPLATE = app
SOURCES += main.cpp

 

 

 

 

 

main.cpp

 

#include <ql/quantlib.hpp>

///GetQuantLibVersion returns the version number of QuantLib currently installed.
///From http://www.richelbilderbeek.nl/CppGetQuantLibVersion.htm
const std::string GetQuantLibVersion()
{
  return QL_LIB_VERSION;
}


#include <iostream>

int main()
{
  std::cout << GetQuantLibVersion() << '\n';
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict