c++_calls_f90_test, a C++ code which illustrates how a C++ main program can call a Fortran90 subroutine.
For this example, the KRONROD package is used. Note that the KRONROD library is available in C++ and in Fortran90, so this example is not created out of necessity (the C++ main program could have simply called the C++ version of KRONROD). Instead, it is intended as an example of how to do this when you have to (you don't have a C++ version of the routines you want to use.)
When calling a Fortran90 routine from a C++ function, there are some simple things that may be enough to guarantee success.
The information on this web page is distributed under the MIT license.
c++_calls_f90_test is available in a C version and a C++ version and a MATLAB version.
c_calls_f90_test, C programs which call a Fortran90 subroutine.
c++_calls_c_test, C++ codes which call a C function.
c++_calls_f77_test, C++ codes which call a Fortran77 subroutine.
f90_calls_c++_test, Fortran90 programs which call a C++ function.
KRONROD, a C++ code which can compute a Gauss and Gauss-Kronrod pair of quadrature rules of arbitrary order, by Robert Piessens, Maria Branders.
KRONROD, a Fortran90 library which can compute a Gauss and Gauss-Kronrod pair of quadrature rules of arbitrary order, by Robert Piessens, Maria Branders.
MIXED, C++ codes which call a function written in another programming language.
kronrod_test is the C++ source code for the main program. Some changes have been made from the standard version in order to adjust for the fact that we are calling a Fortran77 subroutine.