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

Re: : 20010207: netcdf-3.5-beta5.win32b: nc_strerror() failure (fwd)



Hi sandy:

> From: "Ballard, Sanford" <address@hidden>
> To: "'Steve Emmerson'" <address@hidden>
> Subject: RE: 20010207: netcdf-3.5-beta5.win32b: nc_strerror() failure
> Date: Wed, 7 Feb 2001 13:47:29 -0700
> MIME-Version: 1.0
> X-Mailer: Internet Mail Service (5.5.2653.19)
> X-WSS-ID: 169F6BDF309566-01-01
> Content-Type: text/plain;
>  charset=iso-8859-1
> Content-Transfer-Encoding: 7bit
> 
> I tried calling nc_strerror with integers between -61 and -30 and always get
> "Unknown error".
> 
> The fact that the call to nc_inq_libvers returns the correct string
> indicates that my code is loading the dll correctly (true$).

i would think so, but something isnt "correct".

> 
> Is it possible that my code is not linking netcdf.h or netcdf.lib?  I don't
> really understand what the instructions mean about putting netcdf.h in my
> include directory (I don't have one).  I do have a lib directory and I put
> netcdf.lib in it.


netcdf.lib gets linked into your code, so it wouldnt link without it. 

you should try using the static link library (netcdfs.lib)

also see below

> 
> Thanks in advance,
> Sandy
> 
> - -----Original Message-----
> From: Steve Emmerson [mailto:address@hidden]
> Sent: February 07, 2001 1:21 PM
> To: Ballard, Sanford
> Cc: address@hidden; address@hidden
> Subject: 20010207: netcdf-3.5-beta5.win32b: nc_strerror() failure
> 
> Sanford,
> 
> > To: "'address@hidden'" <address@hidden>
> > From: "Ballard, Sanford" <address@hidden>
> > Subject: help
> > Organization: UCAR/Unidata
> > Keywords: 200102071903.f17J2vL27436
> 
> The above message contained the following:
> 
> > I am trying to read some cdf data files using Borland Delphi v 5.0 on a
> > Windows NT machine.  I downloaded netcdf.dll from your ftp site
> >
> (ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/win32/netcdf-3.5-beta5.win32b
> > in.ZIP) and put the following definitions in my Delphi code:
> >
> > function nc_inq_libvers : pchar; external 'netcdf.DLL';
> > function nc_strerror (ncerr : integer) : pchar; external 'netcdf.DLL';
> > function nc_open (path : pchar; omode : integer; var ncidp : integer) :
> > integer; external 'netcdf.DLL';
> > function nc_close (ncidp : integer) : integer; external 'netcdf.DLL';

so, here you have put in a substitute for netcdf.h, which tells the
compiler what the signatures are of those functions. where did you get
these, and are you sure they are the correct data type mappings? is an
"integer" 16 or 32 bits?

> > When I call nc_inq_libvers I get what appears to be a reasonable answer:
> >
> > 3.5-beta5 of Oct 17 2000 10:28:35 $
> >
> > but when I call nc_strerror with any integer (I tried alot of them), I
> > always get back
> >
> > Unknown error
> > I also tried calling nc_open and nc_close and get error codes -33 and 22
> > respectively.
> 
> - -33 means "Not a netcdf id".  I don't know what 22 means (indeed, I
> don't think you should get a 22).
> 
> > What am doing wrong?
> 

simple guess is that you're not giving it a filename that is a netcdf
file. we usually name nectdf files *.nc, while cdf files are ascii.  see
if ncdump works on it.