pretzlstyle
pretzlstyle

Reputation: 2962

Why is HDF5 giving a "too few arguments" error here?

I'm trying to compile a package which uses HDF5, which fails with:

read_hdf5_c.c:537:100: error: too few arguments to function call, expected 8, have 7
      H5Oget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, i, &object_info, H5P_DEFAULT);
      ~~~~~~~~~~~~~~~~~~                                                                           ^
/usr/local/include/H5Opublic.h:190:8: note: 'H5Oget_info_by_idx3' declared here
H5_DLL herr_t H5Oget_info_by_idx3(hid_t loc_id, const char *group_name,
       ^

The definition of H5Oget_info_by_idx3 in H50public.h is

H5_DLL herr_t H5Oget_info_by_idx3(hid_t loc_id, const char *group_name,
    H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info2_t *oinfo,
    unsigned fields, hid_t lapl_id);

which indeed has 8 arguments. The calling code is only passing 7, and also there are only 7 parameters listed in the official docs:

https://support.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfoByIdx

The missing one is unsigned fields.

Could my installation of the hdf5 dev library outdated? Was this 8th parameter removed?

I'm running hdf5 1.12.0

Upvotes: 3

Views: 1661

Answers (1)

clonker
clonker

Reputation: 375

It seems that as of hdf5 1.12.0 the interface changed a little (see the changelog) when they introduced H5Oget_info_by_idx3 and the API documentation lags behind.

I could get it to compile (and more importantly also run) in a project of mine by setting the fields to H5O_INFO_BASIC. In case some fields which are required for you are not contained in the object info struct there is also H5O_INFO_ALL which might do the trick.

Upvotes: 2

Related Questions