Modules
Tim Freeman
timncfc@bigpond.net.au
Mon Feb 14 10:48:00 GMT 2005
François-Xavier Coudert wrote:
>> C:\cygwin\home\Tim\test>gfortran prog.f95
>>
>> C:\DOCUME~1\Tim\LOCALS~1\Temp/ccc5aaaa.o(.text+0x7):prog.f95:
>> undefined reference to `__mymod__hello'
>
>
> You have to link in the object file produced by the first compilation
> step:
>
> gfortran prog.f95 mod.o
>
> so that the hello subroutine (named __mymod__hello since it is in
> module mymod) can be incorporated into the executable code.
>
> FX
>
Hi again,
Is there any way I can do similar by compiling prog.f95 and linking to
the module name, rather than mod.o? If I end up with a large number f95
files each containing a number of modules, it would be nicer to refer to
just the module I want to use. Or should I organise f95 files with
multiple modules into a sensibly named files?
Tim
More information about the Fortran
mailing list