On Jun 12, 12:51pm, Jaehoon Seol wrote:
> Subject: C++ & Fortran 90
>
> Hi,there. Sometimes we can link C++ code with old C code using
> extern linkage specification like;
> extern "C"
> {
> old C code comes here;
> }
The same method should work for Fortran, at least for Fortran-77-
style interfaces. My guess is that if the function interfaces
use the new F90 features, it will be hard (and highly system-dependent)
to get anything to work; but I don't think it should matter
if the underlying code is F90.
Certainly, extern "C" works for F77 procedures being called from
C++ programs, modulo the usual caveats involving system dependence of
doing this kind of thing in general. But if you can call your Fortran
routines from C, then extern "C" should allow you to call them the
same way from Fortran on the same platform.
(Famous last words -- I await the inevitable barage of flames telling
me how wrong I am. :-) )
-P.
--
*********** How can we have ethnic music without ethnic hatred? ***********
* Peter S. Shenkin; Chemistry, Columbia U.; 3000 Broadway, Mail Code 3153 *
** NY, NY 10027; [log in to unmask]; (212)854-5143; FAX: 678-9039 ***
*MacroModel WWW page: http://www.columbia.edu/cu/chemistry/mmod/mmod.html *
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|