This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: REAL_KINDS: a compilation error in Windows but not in Linux ?
- From: Jorge D'ELIA <jdelia at intec dot unl dot edu dot ar>
- To: fortran at gcc dot gnu dot org
- Date: Sun, 14 Aug 2011 13:46:47 -0300 (ART)
- Subject: Re: REAL_KINDS: a compilation error in Windows but not in Linux ?
Tobias / Jerry,
Many thanks for your answers.
(1/2) for Tobias:
> > C:\Users\TEST\gfortran -Wall -std=f2003 -c m_test.f90
> > m_test.f90:6.29:
> >
> > integer, parameter :: isp = REAL_KINDS (1)
> > 1
> > Error: Function 'real_kinds' at (1) has no IMPLICIT type
>
> The error makes perfectly sense: REAL_KINDS is a Fortran 2008 feature.
> thus Fortran 2003's ISO_FORTRAN_ENV does not contain this symbol.
OK. I was not aware of this difference between Fortran 2003 and Fortran 2008.
> Try compiling with -std=f2008.
The compilation is now successful with the flag -std=f2008.
> If you had used ONLY, the error message would have helped a bit more:
>
> use ISO_FORTRAN_ENV, only: real_kinds
> 1
> Error: The symbol 'real_kinds', referrenced at (1), is not in the
> selected standard
Nevertheless, it is somewhat surprising that, for the same compiler
version (4.7.0), this error appears using the wrong flag -std=f2003
only when it is compiled in Windows, and not in Linux.
(1/2) for Jerry:
> Are you using mingw?
No, the windows version of the compiler was downloaded from:
http://users.humboldt.edu/finneyb/gfortran-windows-20110419.exe
> Do you have control characters embedded in your source file?
Not that I know. The original code is developed in Linux and has
numerical oriented. For portability, the code is recompiled on
windows often.
Regards,
Jorge.
--