Missing inttypes.h when compiling HDF5 examples on Windows



I am trying to build the HDF5 examples (tried 1.8.18 and 1.10.1) on Windows Server 2008 using Visual Studio Ultimate 2012. Both with the Visual Studio compiler and the Intel compiler (16.0) I get the error that <inttypes.h> was not found.

At least Intel compiler should support the C99 standard. I have tried passing the flag /Qstd=c99 to the compiler, but still the header file is missing.

Any ideas? Thanks in advance and best regards,


I’ve run into this before, and my understanding is that <inttypes.h> is a common extension and not part of the standard, so isn’t included with some compilers (e.g. MSVC). It shouldn’t be necessary though - it’s mostly just printf-type format macros. <stdint.h> on the other hand defines specific-precision integer types. Which example requires <inttypes.h>?

If it’s being pulled in through <hdf5.h> then check your H5pubconf.h and ensure H5_HAVE_INTTYPES_H is not defined.

Edit: Looks like I added <stdint.h> to my MSVC distro myself… Shouldn’t be necessary though because H5public.h defines the types itself; though it will try to pull in the headers depending on those #defines


Hello Martijn,

thanks for your prompt response. Indeed the H5_HAVE_INTTYPES_H is defined. I tried the quick fix and undefined it, but then some issues with stdbool.h appeared. It is too late to look into this, but I think changing such configure header manually is not very wise… What is the solution here, compile HDF5 on the machine so the configure headers match the system?



Well H5pubconf.h is generated by CMake so running that to correctly configure for your system is probably the best solution. Recompilation seems overkill since changing these includes shouldn’t change anything (even though in principle it could). A workaround for missing <stdbool.h> is also provided in H5public.h as well, so just undefine H5_HAVE_STDBOOL_H too. If you have a CMake install though that’s probably a better approach.


Hello Martijn,

thanks again for your response. I had to undefine H5_HAVE_STDBOOL_H and H5_SIZEOF_BOOL to get the examples compiling. Then some linker issues appeared which I believe are related to the messed up state this ancient Windows Server 2008 installation is in. I think we have to clean up the installation and try again.

Thanks a lot!