OK, so I've downloaded the Fortran netCDF routines from cygwin using setup.exe.
Now, I seem to have what I need, but I cannot put it together.
Here's a little test program:
Program TestnetCDF
implicit none
include 'c:/cygwin/usr/include/netcdf.inc'
integer :: ncid,status
status=nf_open("Kapiti.nc",nf_nowrite,ncid)
end Program
which compiles OK.
But when I try to link:
$ gfortran TestnetCDF.o c:/cygwin/lib/libnetcdff.dll.a
TestnetCDF.o:TestnetCDF.f90:(.text+0x24): undefined reference to `nf_open_'
collect2: ld returned 1 exit status
What am I doing wrong?
________________
Derek Goring
From: marco atzeri <marco.atzeri@xxxxxxxxx>
To: Derek Goring <nztideman@xxxxxxxxxxx>
Cc: "netcdfgroup@xxxxxxxxxxxxxxxx" <netcdfgroup@xxxxxxxxxxxxxxxx>
Sent: Friday, 14 June 2013 10:17 PM
Subject: Re: [netcdfgroup] Win 7 Fortran netCDF
On Fri, Jun 14, 2013 at 3:24 AM, Derek Goring wrote:
I'm trying to build netCDF-Fortran 4.2 under cygwin in Win 7 64 bit, but
./configure results in this message:
>configure: error: netcdf.h could not be found. Please set CPPFLAGS.
>
>I cannot find netcdf.h anywhere and Google was not much help.
>
>
netcdf-fortran is already available as cygwin package
libnetcdf-fortran-devel-4.2-2 Fortran header and development lib
libnetcdf-fortran_5-4.2-2 dynamic libraries
netcdf.h should be in
libnetcdf-devel-4.2.1.1-2 C header and development lib
Can anyone help?
>
>
>________________
>Derek Goring
>
>
>
Regards
Marco