This problem of creating a fortran dll for calling in MAPLE is now solved. The solution is explained and exemplified below.
My first attempt at generating dll with fortran g77 failed because g77 does not have a -shared option to generate a dll.
The gfortran complier in the gcc collection does have the -shared option for dll generation. However, my attempt at using gfortran from the MinGw gcc compiler set (under Windows 7) failed to create an executable let alone a dll. I was unable to diagnose the cause.
Finally, I installed Cygwin (on a Windows 7 laptop). This includes the gcc collection of compilers, and I was thus able to successfully generate a dll. A key step was setting an environmental path variable to the cygwin1.dll in C:\cygwin64\bin to enable its link from the .dll to be resolved.
The gfortran compile sequence was as follows: First compile myfunc.c into object code:
gfortan -c myfunc.for
in which myfunc.for defines the FORTRAN function mult(a,b) where a and b are real numbers being multplied together. Then, using gfortran we build a shared library from the object file:
gfortran -shared -o myfunc.dll myfunc.o
The dll is then called up to define a function in MAPLE as follows:
We then find that:
[seq(fmult(2*j, 5*(j-1)), j = 1 .. 10)];
[0., 20., 60., 120., 200., 300., 420., 560., 720., 900.]
This completes the example. The difficultly lay not with MAPLE, but with finding and apt implementation of the gcc compiler set.