You are essentially correct - there is a problem. However, it is possible toQuote:
>It appears that if a Fortran program calls a C program, and the C
>program calls the routine getenv, the program crashes. If I comment
>out getenv in the routines that call it, and pass the GRAPHCAP & FONTCAP
>info on the command line, the example program works fine.
mix FORTRAN and C with a C routine that calls getenv - just make sure you
link in the C runtime library... as in:
test1: $(COBJS) $(FOBJS)
xlf $(FFLAGS) -o test1 $(COBJS) $(FOBJS) -lc
Ordinarily the linker will satisfy the reference to getenv from the FORTRAN
Now, there is a problem if BOTH the FORTRAN and C routines call their
respective getenvs - There can only be one getenv symbol in the final
bound product so someone looses.
This is my signature. There are many like it, but this one is mine.
Georgia Tech UUCP: ..!gatech!prism!scott
Office of Information Technology, Technical Services