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

Arjen Markus arjen.markus895@gmail.com
Tue Feb 2 10:18:00 GMT 2016


Hi Nick,

I am not thoroughly familiar with C# - but if the routine is called
(and it starts), then writing to a file would give an indication
whether it proceeds or not. That ought to be independent of console
I/O.

Regards,

Arjen

2016-02-02 11:11 GMT+01:00 N.M. Maclaren <nmm1@cam.ac.uk>:
> 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