Thanks to all who responded. I now have it "half" working,
but I'm stuck on the half that's not working, nor do I
really understand why the half worked.
If I change the 'include "f90_include.h"' statement to
'#include "f90_include.h"', then I can get the first subroutine
in the file to compile fine. However, the second routine in
the same file (a duplicate of the first except given a
different name and having different argument types) will
not compile, complaining about undefined variables.
For instance:
Subroutine Works1( ... )
#include "c_include.h"
#include "f90_include.inc"
<reference to variable defined in c_include.h file>
return
end subroutine Works1
Subroutine ShouldWork( ... )
#include "c_include.h"
#include "f90_include.inc"
<reference to variable defined in c_include.h file>
return
end subroutine ShouldWork
Subroutine Works1 compiles fine, but subroutine ShouldWork
does not. They're both in the same file. If I put the
two routines in separate files, then everything compiles
again ??
And, does a patient person mind explaining why the #include
is needed for the "f90_include.inc" file? If the preprocessor
runs first and gathers all the references from "c_include.h",
shouldn't they already be in place by the time the compiler
starts and hits the 'include "f90_include.inc"' statement?
Why does the f90 include have to be handled by the preprocessor
and not the compiler? Doesn't the "include xxx" statement
simply copy the text xxx into the code body?
Thanks,
Catherine
--
-------------------------------------------------------------------------
Catherine Moroney phone : (818) 393-3392
Jet Propulsion Laboratory fax : (818) 393-3134
MailStop 168-414 email : [log in to unmask]
4800 Oak Grove Drive
Pasadena, CA 91109-8099
|