Windows applications, bind C and Cygwin64

FX fxcoudert@gmail.com
Fri Jul 26 15:02:00 GMT 2013


> If I understand what Janne and Tobias wrote, there isn't any bug but only the choice of linux strategy for Cygwin64,

Yes, it's not a bug, it's Cygwin64's choice.


> which makes things a little more complicated to program with iso c binding.

Not exactly. Using C binding will get you exactly what you want, which is it will bind Fortran types to C types. The problem in your case is the difference between C types as provided by the compiler (which follows Cygwin64's ABI choice, i.e. long is 64-bit), compared to the C types used in Win32/Win64 API's (which require a 32-bit LONG type).

So, it's not a Fortran / C binding question, it's a compiler vs. OS API question.

> It seems that the suggestions of Tobias fix some of the issues I meet.

Yes, just assume that Win32/64's LONG type is your compiler's "int" type (and not "long"), and you should be fine.

FX


More information about the Fortran mailing list