write, open and read statements in a fortran dll causing program to hang

N.M. Maclaren nmm1@cam.ac.uk
Tue Feb 2 10:12:00 GMT 2016


On Feb 2 2016, Arjen Markus wrote:
>
>just a hunch, but could it be that under C# there is no console to
>which the library can write? What happens if you change the write(*,*)
>statement to write(10,*) ?
>
>(I think this would be better asked on comp.lang.fortran, as it does
>not seem specific to gfortran)

It's probably not that, and is almost certainly specific to the C#/gfortran
combination.  It is extremely common for two languages' handling of the
standard input, output and error (if different) streams to be incompatible.
In general, those should be used only from the 'master' language (usually
the one with the main program), and the other language should call back to
procedures in that to do I/O.

I don't even know if gfortran supports standard I/O compatibility with
gcc, and that will have some serious gotchas even if it is supported.
But compatibility with C# would be a major commitment.


Regards,
Nick Maclaren.



More information about the Fortran mailing list