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

Re: example.cc problem



Hi Yu-Long,

>    I just build libnetcdfc++.a and try to run example.cc under cxx dir.
> I got an error message shown below
> 
> example.cc:68: no matching function for call to `NcVar::put (long int[2], 
> unsigned int)'
> netcdf.hh:244: candidates are: NcVar::put(const double *, const long int *)
> netcdf.hh:243:                 NcVar::put(const float *, const long int *)
> netcdf.hh:242:                 NcVar::put(const int *, const long int *)
> netcdf.hh:241:                 NcVar::put(const short int *, const long int *)
> netcdf.hh:240:                 NcVar::put(const char *, const long int *)
> netcdf.hh:239:                 NcVar::put(const unsigned char *, const long 
> int *)
> 
> thus, I change example.cc code line 68 
> from 
> static long frtimes[] = {12, 18};
> into
> static nclong frtimes[] = {12, 18};
> 
> then I can compile and link w/o problem.  The problem is while I run it,
> I got a segmentation Fault.  Any hint on this problem will be
> appreciated.

Yes, I didn't realize the old "example.cc" file was still being included in
the netCDF source distribution.  Your change from "long" to "nclong" for
the frtimes[] declaration is correct.

But after making this change, I can't duplicate the segmentation fault you
are seeing.  The resulting program seems to compile and run correctly on
both Solaris 2.5 and IRIX64 6.1.  On what platform are you seeing the
segmentation fault?

--Russ

______________________________________________________________________________

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