[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #NYE-925598]: Fortran access to NetCDF under Windows



> > Dear Support
> >
> > I am trying to compile and run a fortran program in Windows XP that 
> > accesses a number of NetCDF files.  I am using Digital Visual Fortran 
> > (Microsoft visual studio) and I get error messages when I try to build a 
> > fortran program that calls NetCDF files.
> >
> > atmemcd.obj : error LNK2001: unresolved external symbol _NF_INQ_VARID@16
> > atmemcd.obj : error LNK2001: unresolved external symbol _NF_GET_VAR_REAL@12
> > atmemcd.obj : error LNK2001: unresolved external symbol _NF_CLOSE@4
> >
> > I have downloaded the netcdf-3.5.1-win32dll---for fortran use.zip and 
> > extracted netcdf.dll, .exp, and .h into the windows/system32 directory.
> > I have also used the netcdf.lib and netcdf.inc from the netcdf-3.5.0.zip 
> > release and placed these into the include and library directories of the 
> > compiler, as well as in the system32 directory for good measure.
> >
> > I'm afraid that I am not very experienced in programming, and I am trying 
> > to compile someone else's program here.    I have tried adding all of the 
> > previously listed files to the project, and this removed the errors that I 
> > was getting regarding the availability of netcdf.inc [which is listed 
> > explicitly in the program at the beginning (include netcdf.inc)]  However I 
> > am still unable to build and run the main program.
> >
> > Is there a step that I have missed out?  Thank you very much for any advice 
> > that you can give me.
> >
> > Warren Hamilton
> >
> >
> 
> Howdy!
> 
> Sorry about your windows problems. Another user reports that this is caused 
> by a recent change in MS Visual Studio.
> 
> Stand by for the next netcdf 3.6.2 beta release, which (I hope) will compile 
> under MSYS and produce DLLs without involving visual studio.
> 
> Thanks,
> 
> Ed


At long last I am able (I believe) to produce a netCDF DLL which contains the 
fortran wrappers.

I am not sure whether this works from your fortran yet. If you could try, and 
let me know, that would be very helpful. (Other flavors of fortran are now easy 
for me to build, I just have to know which one will work for you).

The new DLLs are at:

ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/win32/netcdf-3.6.2-beta5_pgi_w32bin.zip

The DLL is called "libnetcdf-0.dll", copy that to 
\windows\system32\libnetcdf.dll (note that the "-0" has to be taken out of the 
name, I believe).

This is pretty experimental at this point (I am testing it now), but if you 
could give it a try and let me know if it works, that would be very helpful!

Thanks,

Ed

Ticket Details
===================
Ticket ID: NYE-925598
Department: Support netCDF
Priority: Critical
Status: Closed