> I'm trying to compile a program that use a module ('load_dff') from a
> I use the -Idir option but the compiler responds with messages like this:
> undefined reference to `__load_dff_MOD_loaddenovofluxfile2'.
> If I copy the module to directory where I have de program the compilation
> goes without problems.
Regarding the compiler: If you compile a module named "m" in a file
"foo.f90", the compiler generates two files:
- foo.o as normal compiled file with all actual procedures,
module variables etc.
- m.mod with the interface of the module procedures, the names
of the module variable etc.
When compiling another file (e.g. "bar.f90") the compiler reads
the m.mod file – this seems to work.
At the end, when generating the binary, the linker needs to combine
bar.o and foo.o to the final program.
From the error message, it seems as if "foo.o" is missing, i.e. you
need to do:
gfortran -I... bar.f90 foo.o
and I think the "foo.o" is missing in your case.
I believe that you tested before
gfortran foo.f90 bar.f90
or something like that, which also works as it compiles first
foo.f90 and then bar.f90.
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter