为什么HDF5在这里给出"too few arguments"错误?



我正在尝试编译一个使用 HDF5 的包,它失败了:

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,
^

H50public.hH5Oget_info_by_idx3的定义是

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);

确实有 8 个参数。调用码只通过 7,官方文档中也只列出了 7 个参数:

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

缺少的是unsigned fields.

我的 hdf5 开发库安装会过时吗?删除了第 8 个参数吗?

我正在运行 hdf5 1.12.0

似乎从 hdf5 1.12.0 开始,当他们引入H5Oget_info_by_idx3时,界面发生了一些变化(请参阅更改日志(,并且 API 文档滞后。

我可以通过将fields设置为H5O_INFO_BASIC来让它在我的项目中编译(更重要的是也可以运行(。如果您所需的某些字段未包含在对象信息结构中,则还有H5O_INFO_ALL可以解决问题。

相关内容

最新更新