Hello, I'm not sure why exactly your program is crashing; it could be for any number of reasons. Using a debugger like gdb would help tell you exactly at which line the program is core dumping, and why. Unfortunately the code snippet you provide does not give enough information; for example, I don't see how dsec is instantiated. It's possible that it has been improperly declared, for example. USE_NETCDF4 is defined during the 'configure' process, when the script checks to see if you are compiling netCDF with netCDF4 support. It is only defined when building the library, however; you should not need to define it explicitly. -Ward > Dear Sir, > > I'm reading header of satellite data (netcdf4 format ) in a c programm > > > nc_open ( " > OR_HFD-020-B14-M1C07-T073_GH8_s2015197135000_c2015197140528.nc", > NC_NOWRITE, &ncid ); > > /* > * Get the x and y dimensions of the image. > */ > nc_inq_dimlen ( ncid, 0, &jy ); > nc_inq_dimlen ( ncid, 1, &jx ); > (I get jy = 550; jx = 688 match the result of ncdump) > > > When I tried: > > /* > * Get the date/time. It is stored as the number of seconds > * since 00:00:00 UTC, January 1, 1970. > */ > nc_get_var1_double ( ncid, 1, 0, &dsec ); > > I got: > Segmentation fault (core dumped) > > Do you know the reason? > How do I make sure that I define USE_NETCDF4 so that: it can excutes: > > if(memtype >= NC_FIRSTUSERTYPEID) memtype = NC_NAT; > > > *********************************************************************************** > > > #ifdef USE_NETCDF4 > if(memtype >= NC_FIRSTUSERTYPEID) memtype = NC_NAT; > #endif > > ************************************************************************************* > from netcdf-4.3.3.1/libdispatch/dvarget.c > > > > Thank you for your help! > > Shucai > > > > Ticket Details =================== Ticket ID: QIC-858208 Department: Support netCDF Priority: Normal Status: Closed
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.