Reading netcdf files with borland builder c++ enviorement - the solution

Jacek Dlugosz dlugosz at ietu.katowice.pl
Tue Oct 10 07:29:24 MDT 2006


Hi all.

Browsing Netcdf archives I found a question without the answer - how to
use netcdf library under the Borland Builder environment.
I will try in a few words to deliver the solution.

You need two objects:

- precompiled binaries for Windows:

ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/win32/netcdf-3.6.1-win32.zi
p

and netcdf.h file which you are able to find in this archieve:

ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf.tar.gz

Then you should copy files from netcdf-3.6.1-win32.zip (except
netcdf.lib) this way when an instruction is describing it.
http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-install/

You now have to create the import library compatible with the Borland
standard.
You need the netcdf.dll file in this purpose.
To obtain correct library you shoud execute following commands from the
command line:

  impdef -a netcdf.def netcdf.dll
  implib -a netcdf.lib netcdf.def

You now have a Borland compatible netcdf.lib file.

The last thing to do is copying files into the adequate place:

  netcdf.h -->> Borland\CBuilderX\include
  netcdf.lib -->> Borland\CBuilderX\lib


That's all - now you can use netcdf library using #include <netcdf.h>
directive.

Jacek Długosz.




More information about the netcdfgroup mailing list