Question on HDF5 C++ Interfaces in -1.6.5/1.6.6/1.6.7

Hi Elena, Binh-Minh, Quincey -

        The work around provided by Binh-Minh works good with HDF5-1.6.5.
        Thanks for your the support. :slight_smile:

Anish Anto

Elena Pourmal <>
06/19/2008 09:19 AM

Anish Anto <>
Quincey Koziol <>, Binh-Minh Ribler
Re: Question on HDF5 C++ Interfaces in -1.6.5/1.6.6/1.6.7


Could you please try a workaround recommended by Binh-Minh?

Please let us know if it worked. But we will not be able to fix 1.6.5, so
please use newest version of HDF5 if possible.

Thank you!



On Jun 19, 2008, at 1:12 AM, Binh-Minh Ribler wrote:

Hi Elena,

The C++ API constructor DataType(PredType::NATIVE_INT) had a bug in 1.6.5
and returned an incorrect id, which was 80 in this case, so I fixed it and
since then it returns the correct one. Hmm, I just repeated what he said,
didn?t I? I think he can use DataType::copy to work around but I?ll have
to check when I get back.

Talk to you later!

From: Elena Pourmal []
Sent: Wednesday, June 18, 2008 9:17 PM
To: Binh-Minh Ribler
Cc: Quincey Koziol
Subject: Fwd: Question on HDF5 C++ Interfaces in -1.6.5/1.6.6/1.6.7

Hi Binh-Minh,

Could you please help when you are back?

Thank you!


Begin forwarded message:

From: Anish Anto <>
Date: June 18, 2008 6:23:34 PM CDT
To: Quincey Koziol <>, Elena Pourmal <>
Subject: Question on HDF5 C++ Interfaces in -1.6.5/1.6.6/1.6.7

Hi Quincey, Elena

This code attached below works well with HDF5- 1.6.6/1.6.7/1.8.0/1.8.1 on
However, since infrastructure is currently comprised with HDF5 -1.6.5, i
found that some of my application interface code that was developed using
HDF1.6.6 was not working with HDF5-1.6.5.

hsize_t dimsf1[]={1};
H5File file("c:\\testhdf5165.h5", H5F_ACC_TRUNC );

//This objects gets created but return with a ID of 80
DataType type(PredType::NATIVE_INT);
DataSpace sid1(1, dimsf1);

DataSet dset = file.createDataSet("dset",type,sid1);

back trace:
HDF5-DIAG: Error detected in HDF5 library version: 1.6.5 thread 0. Back
trace f
  #000: ..\..\src\H5D.c line 1076 in H5Dcreate(): not a datatype ID
    major(01): Function arguments
    minor(03): Inappropriate type

Failure at , File : H5D.c

H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
          hid_t dcpl_id)
    if(H5I_DATATYPE != H5I_get_type(type_id))
        HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype ID")

Question: Is there a work around to create a DataType Object properly, so
that createDataSet would work on HDF1.6.5 ?
On all versions after 1.6.5, the DataType object gets constructed well
and gives a good ID, not 80.