Hi Zane,

 

The predefined type should be in the form of H5::PredType::NATIVE_FLOAT, not
H5::H5T_NATIVE_FLOAT.  I'm surprised it passed the compilation.  Does
FloatType::FloatType( const PredType& pred_type ) work for you?

 

Binh-Minh

 

  _____  

From: [email protected] [mailto:[email protected]]
On Behalf Of Zhengying Wang
Sent: Wednesday, January 04, 2012 5:04 AM
To: '[email protected]'
Subject: [Hdf-forum] Construct H5::DataType with predefined datatype in
C++1.8.6

 

Hi,

 

I'm in the process to upgrade our application from 1.6.5 to 1.8.6. I have
noticed the constructor of H5::DataType (hitd_t existing_id, bool
predefined) has changed to H5::DataType (hitd_t existing_id). The interface
changes do make sense from the point view of users, however I have problem
to create an object with the predefined datatype - Here is a very simple
example:

 

#include <H5cpp.h>

int main ()

{

  H5::DataType (H5::H5T_NATIVE_FLOAT);

 

 return 0;

}

 

The destructor complains with the following errors:

 

DataType::~DataType - H5Tclose failed

HDF5-DIAG: Error detected in HDF5 (1.8.6) thread 140429119538976:

  #000: H5T.c line 1723 in H5Tclose(): immutable datatype

    major: Invalid arguments to routine

    minor: Bad value

DataType::~DataType - H5Tclose failed

 

 

I also tried to the following code:

 

#include <H5cpp.h>

int main ()

{

  H5::DataType (H5::PredType::NATIVE_FLOAT);

 

  return 0;

}

 

The code works for 1.8.6 but not 1.6.5 unfortunately.

 

Here are the errors when trying to insert the object to a compound datatype.

 

HDF5-DIAG: Error detected in HDF5 library version: 1.6.5 thread 3077396992.
Back trace follows.

  #000: H5Tcompound.c line 351 in H5Tinsert(): not a datatype

    major(01): Function arguments

    minor(03): Inappropriate type

H5Tinsert failed

 

 

Could anyone please instruct a proper way to construct H5::DataType with the
predefined datatype? It'd be nice if the code can work in both 1.6.5 and
1.8.6.

 

Thanks,


Zane

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to