problem using netcdf and Borland Delphi

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 the unidata 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';

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 a lot of them), I
always get back

Unknown error

I also tried calling nc_open and nc_close and get error codes 22 and -33
respectively.

Does anyone have any insights into what I might be doing wrong?  I suspect
it has something to do with the netcdf.h and netcdf.lib files.  I don't know
how to tell Delphi where they are.  Delphi doesn't use .lib or .h files.
Are these files necessary?  Doesn't netcdf.dll contain everything my code
needs to know?

Thanks in advance,
_________________________________________
Sandy Ballard



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