unresolved externals in PGI Fortran for WIndows

Hi,

I’ve met a problem when I was trying to build an application by PGI Fortran 7.1-2 Win32.

The short test case is below. Originally it was 416.gamess benchmark from SPEC CPU2006.

$ cat m.f

      PROGRAM BUG
      CALL HSSFUL
      END

$ cat hess.fppized.f

      SUBROUTINE HSSFUL
        CALL UPRCAS(WORD,8)
      RETURN
      END

$ cat frfmt.fppized.f

      SUBROUTINE UPRCAS(STRING,LENSTR)
        CHARACTER*(*) STRING
      RETURN
      END

pgf95 frfmt.fppized.f m.f hess.fppized.f
frfmt.fppized.f:
m.f:
hess.fppized.f:
hess.fppized.obj : error LNK2019: unresolved external symbol _UPRCAS@8 referenced in function _HSSFUL@0
frfmt.fppized.exe : fatal error LNK1120: 1 unresolved externals

However I’ve observed that if the files are compiled with -Munix the application has been being built and no unresolved symbols appeared.

So, the first question is what does my problem look like?
And is it a proper way to use -Munix for such case?

Thanks,
Alexander

Posted to wrong forum :(.
Please move to Programming and Compiling.

Hi Alexander,

You will need to give a type for variable WORD in HSSFUL. UPRCAS expects character as an argument. In Fortran, if you don’t specify the type, it will assum it is real.

For example,
SUBROUTINE HSSFUL
character*10 WORD
call UPRCAS(WORD,8)
return
END

Hongyon