Re: [netcdfgroup] Win 7 Fortran netCDF

Il 6/25/2013 6:12 AM, Derek Goring ha scritto:
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.

Hi Derek,
cygwin is a unix emulation layer, so go on unix way

Here's a little test program:
Program TestnetCDF

implicit none

include 'c:/cygwin/usr/include/netcdf.inc'

include '/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

gfortran TestnetCDF.f -lnetcdff -o TestnetCDF


What am I doing wrong?

-lnetcdff means link with "netcdff library in the default search path"

Regards
Marco




  • 2013 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: