Creating a compound datatype with no predefined struct

The problematic line is:
hsize_t compound_dtype_size = sizeof(compound_dtype);

The documentation states:

[in] type_size The size in bytes of the structure associated with the table; This value is obtained with sizeof().

Notice that it says “… the structure associated with the table,” which you said you don’t have.

Clearly, sizeof(compound_dtype) == sizeof(hsize_t) == 8 < 28, which is the problem.

sizeof() can work only with a predefined struct. The documentation should be clearer on this.

What would work is hsize_t compound_dtype_size = H5Tget_size(compound_dtype);

OK?

G.