0

I tried building the first example here and got errors. Right on the first line there's a missing include statement, but I managed to figure out it should be

#include "hdf5.h"

But even after fixing that I got more errors:

$ h5cc ./example1.c 
./example1.c: In function ‘main’:
./example1.c:66:4: error: too few arguments to function ‘H5Dcreate2’
In file included from /usr/include/hdf5.h:27:0,
                 from ./example1.c:6:
/usr/include/H5Dpublic.h:104:14: note: declared here

Any idea how to solve it?

4

1 回答 1

3

The example code was written for release 1.6 of hdf5, and as such will simply not compile on a 1.8 release without modification.

If you want to get the code to work on 1.8, you need to enable 1.6 compatibility, which means passing in the flag:

-DH5_USE_16_API

to the h5cc command line like:

h5cc -DH5_USE_16_API ./example1.c

and it should compile correctly; otherwise you will have to rewrite the code to make use of the 1.8 API.

于 2013-09-01T10:53:09.827 回答