From: Craig Powers on
FlyVenus wrote:
> Hi, All:
> I plan to using a fortran 90 program in C++. I have no experience
> about that, and I have some question about that.
>
> 1. I think I have two methods to using the fortran 90 program.
> First, compile all the .f90 and .cpp to .obj, and link them. Second,
> make the fortran 90 program to a dll, and call it in C++ project. I
> want to know, which is better, and how I should do?

The second method is likely to involve less pain in terms of figuring
out which linker to use, etc. You will still need to use the manual for
your Fortran compiler to make sure that your Fortran routine in the dll
is designed correctly to be called from C++.

> 2. In the fortran 90 program, there many Types. How can I using
> them in C++.

See the manual for your Fortran compiler on mixed language programming.
Possibly, all you will need to do is specify SEQUENCE and make sure
that the TYPEs are compatible with C++ (i.e. no pointers or allocatables).