Using a DLL/shared library created with gfortran with a program created with another compiler

Arjen Markus arjen.markus@wldelft.nl
Tue Jan 13 10:19:00 GMT 2009


> On Mon, 2009-01-12 at 14:11 +0100, Arjen Markus wrote:
>> I could not get it to work properly using gfortran - most probably
>> because of the fact that gfortran produces a name in lowercase,
>> whereas the Intel Fortran compiler generates external names in
>> uppercase
>> (at least by default).
>
> Why not use the ISO C binding?  That way, you could specify whatever
> name you wish, including upper- and lowercase.
>

Hello Thomas,

I tried it and it worked fine.

Just a few remarks:
- gfortran complained about bind(c,'NAME'), but it accepted
  bind(c,name='NAME').
  (I am not sure if the first form is legal syntax)
- gfortran also warned about the fact that the arguments
  to the routine did not have the bind(c) attribute. Not a
  big problem in this experiment, but if this gets used
  by unsuspected users, then I will need to suppress them
  (by supplying the bind(c) attribute of course).

Regards,

Arjen



More information about the Fortran mailing list