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

Re: example.cc problem



Yu-Long,

>      I got two questions for you while I try to modify netcdf to run under
> bc++ 5.0.
> 
> 1) netcdf.cpp
>    member function
>    long NcVar::num_vals(void)const
>    {
>    ...
>     for(int d=0;dim=get_dim(d);d++)
>     prod *=dim->size();
>    ...
>    }
>    while I compile it, I got the error message, possible incorrect assignment,
>    I get confused about dim=get_dim(d)?  Could you check that for me?

I don't know how you have declared "dim", but for the above to work, it
must be an "NcDim *", not just an "NcDim".  That may be the source of the
error message.

>     I change the codes to
> 
>     for(int d=0;d<num_dims();d++){
>        prod *= get_dim(d)->size();
>     }
> 
>     is this ok?  

Yes, that looks like it should work OK too.

> 2) in xdr.h
>    there are list 
>    extern void xdrmem_create()
>    extern void xdrstdio_create() .. and so on.
>    I could not find those functions under xdr direction's c code.  Are
>    those functions necessary for netcdf 2.4.1's xdr?   Though there
>    is no problem to build xdr lib and there are no functions call
>    related to those extern function under xdr directory's c code, is
>    that ok to ignore those functions' body?

I think you won't need these, but xdrstdio_create() at least is defined in
../libsrc/xdrstdio.c.  However, I think the current version actually
doesn't even use that file, so it's not needed.  The guy who wrote this
(Glenn Davis) is on vacation for another week or so.  You should probably
check whether your system has its own XDR library, so you don't have to use
the one we provide.  You might also check what's in

    ftp://isdl.whoi.edu/pub/tcc_cdf_232.tar

as I think this has versions of XDR compiled for Borland Turbo C++ that you
might just be able to use.  Also, see Ken Prada's notes about compiling
netCDF for Borland in

    ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/borland/ORIGIN

--Russ

______________________________________________________________________________

Russ Rew                                           UCAR Unidata Program
address@hidden                              http://www.unidata.ucar.edu