Contents
General Information
- CMake Support in the HDF Software
- Supported Windows Compilers (CMake, Visual Studio)
- Do you support large files on Windows?
- Can I change the name of generated DLLs?
- Memory leaks using HDF DLL in the MFC environment?
- Does HDF work with Managed C++ (Windows .NET)?
- Which external libraries should I link with?
HDF4 and HDF5
- Why do we see "NODEFAULTLIB warnings" in my build?
- When I build HDF(4 or 5), I find the following errors: "Cannot open zlib", or "Cannot open szlib".
- When I build from command line, can I set path for external libraries and header through INCLUDE and LIB environment variables?
- When compiling an application with the pre-compiled binaries, I get the error, "unresolved external symbol errno." How do I get rid of this?
HDF4 Questions
- When I link my application with HDF4, I get the error "libjpeg.lib(jerror.obj) : error LNK2019: unresolved external symbol iob referenced in function _output_message".
- When I link my application with HDF4, I get the error "error LNK2001: unresolved external symbol xdr_opaque"
- When I link my application with HDF4, I get the error "error LNK2001: unresolved external symbol ntohl"
HDF5 Questions
- When I build my application, I'm getting unresolved external symbols. How can I fix this?
- When I build HDF5 library, I got the following error: "Cannot open source file: '..\..\..\test\gen_bogus.c'"
- When I build HDF5 library, I got the following errors "Could not open source file H5pubconf.h"
- Is the stream-vfd driver supported on Windows?
- Can I use parallel HDF5 on Windows?
- Can HDF5 run on cygwin?
- Do you have examples of HDF5 applications?
- What compilers and platforms does HDF5 support?
- I successfully build the new HDF5 library. When I use "hdf5test" to test the hdf5 DLL I find an enormous number of errors, including a crash. What was wrong?
- How can I make HDF5 1.8 backwards compatible with HDF5 1.6?
- Building an application, I get unresolved external symbol H5T_NATIVE*_g errors.
- When I link my Fortran application I get the error "Unresolved external symbol __imp__H5LIB_mp_H5OPEN_F@4 referenced in function _MAIN_".
- When I build HDF5 with Cygwin, I get errors about 'time' or 'timezone'
- When I test HDF5 with hdf5check.BAT, I get errors in 'fillval' test.
- Can I call HDF5 library within C#?
- Can I use thread-safe feature on Windows?
- With .NET APIs get "The specified module could not be found."
CMake Support in the HDF Software
As of 2011, we have added support for CMake in the development software for HDF4, HDF5, and the H4H5Tools. This corresponds (or will correspond) to the following releases:
HDF5-1.8.6
HDF 4.2.6
H4H5Tools 2.1.2
Supported Windows Compilers (CMake, Visual Studio)
The following compilers are supported on Windows for HDF5-1.8.6, HDF 4.2.6, and H4H5Tools 2.1.2:
HDF5-1.8.6:
VS 2008 and IVF 10.1
CMake 2.8.2
HDF 4.2.6:
VS 2008 and IVF 10.1
CMake 2.8.2
H4H5Tools 2.1.2:
VS 2008
CMake 2.8.2
Project files are *only* available for VS 2008 for these versions.
However, project files for other versions of Visual Studio can easily be generated using CMake. See the ./release_docs/CMake.txt file in the HDF5 source code for details.
Do you support large files on Windows?
HDF5 doesn't have any limit on the size of files. However, some file systems have their own constraints.
- The NTFS can build HDF5 files greater than 4GB.
- The FAT32 file system cannot have a file greater than 4GB. So HDF5 files can not be bigger than 4GB.
- A program compiled with the Borland C++ compiler can not use files greater than 2GB.
Can I change the name of generated DLLs?
Yes, so long as the new file name does not collide with another DLL on the system.
Memory leaks using HDF DLL in the MFC environment?
Currently we do not support the MFC environment.
Does HDF work with Managed C++ (Windows .NET)?
HDF5-1.6.2 was successfully built and tested using Managed Extensions on the C++ projects. HDF5 1.8 has not been tested, but should work as well. You can find a summary of the build process here.
Also, if you are planning on integrating your project with .NET, you may be interested in our HDF5 .NET project.
Which external libraries should I link with?
The SZIP and ZLIB libraries are optional in HDF5.
HDF4 requires ZLIB and JPEG, and SZIP is optional.
HOWEVER, the pre-built HDF5 software is built with the SZIP and ZLIB external libraries and therefore requires them. Similarly, the pre-built HDF4 binaries are built with SZIP, ZLIB, and JPEG, and require them.
Can I call HDF5 library within C#?
Yes! Please read about the HDF5 .NET project here .
Why do we see "NODEFAULTLIB warnings" in my build?
It is possible that CRTDLL.dll, MSVCRTD.dll or some other Visual Studio DLL has conflicting definitions of some symbols. This message is merely a warning, and can be safely ignored. However, if you would like to disable the warning, you may take the following steps:
- In Visual Studio, right click on the project that is causing the warnings, and go to "Properties."
- In the left pane, select "Linker", "Input"
- Now there are two options, you may either change the option "Ignore All Default Libraries" to "Yes," or enter the name of the conflicting library in the field "Ignore Specific Library."
Can I use thread-safe feature on Windows?
Yes, we do support this feature. Please see the details in section "How to build HDF5 with Thread-Safe Feature", in the document INSTALL_WINDOWS.txt.
Warning: The Pthreads package on windows doubles the memory use of the program.
When I build HDF(4 or 5), I find the following errors: "Cannot open zlib", or "Cannot open szlib".
The path to szip and zlib include files must be setup correctly within Visual Studio. Make sure the path is correctly set inside of the "VC++ Directories" settings for both Include files and Library files.
When I build from command line, can I set path for external libraries and header through INCLUDE and LIB environment variables?
Yes! This option is now available for both HDF4 and HDF5 1.8. Please see the
appropriate documentation about the /useenv option.
When compiling an application with the pre-compiled binaries, I get the error, "unresolved external symbol errno." How do I get rid of this?
This problem is due to the settings of the project.
Make sure that the workspace you are using is a Fortran console application (Fortran) or Win32 Console Application (C).
When I link my application with HDF4, I get the error "libjpeg.lib(jerror.obj) : error LNK2019: unresolved external symbol iob referenced in function _output_message".
Verify that you are using the correct version of libjpeg for your compiler. It is important that you don't use binaries for a different version of Visual Studio, because it will likely be built with different runtime libraries. You can find the correct version of libjpeg here.
When I link my application with HDF4, I get the error "error LNK2001: unresolved external symbol xdr_opaque"
When linking your application with HDF4, you must link with xdr.lib in addition to the other HDF4 libraries. In your project settings, make sure you specify "xdr.lib" on your linker input line.
When I link my application with HDF4, I get the error "error LNK2001: unresolved external symbol ntohl"
On Windows, we require linking with the standard Windows library Ws2_32.lib as well. This provides functions defined in winsock2.h, such as ntohl and htonl. In your project settings, make sure you specify "Ws2_32.lib" on your linker input line.
When I build my application, I'm getting unresolved external symbols. How can I fix this?
Check the instructions for building an application to be sure you are specifying everything that is required. These instructions can be found in the INSTALL_Windows.txt file that is in the release_docs/ directory of the HDF5 source code. Section IV discusses how to build an application using the HDF5 library or DLL.
Please be aware that there are several pre-processor definitions that you may need to specify, if using DLLs:
- HDF5CPP_USEDLL to use HDF5 C++ DLL
- _HDF5USEHLDLL_ to use HDF5 high level DLL
- HDF5USE_HLCPPDLL use HDF5 high level C++ DLL
- HDF5F90_WINDOWS to use HDF5 Fortran DLL
When I build HDF5 library, I got the following error: "Cannot open source file: '..\..\..\test\gen_bogus.c'"
In the source tarball for HDF5 1.8.0, the source code for project "ohdr_gentst" was not included. The project exists to create HDF5 files that are used as input to the "ohdr" test program. The input files have been included in the source tarball, so the "ohdr_gentst" can be safely disabled. You may either disable the "ohdr_gentst" project in Visual Studio's "Configuration Manager," or simply ignore this error.
When I build HDF5 library, I got the following errors "Could not open source file H5pubconf.h"
Before you build HDF5, you will need to run copy_hdf.bat from the .\windows directory. This batch file will copy all of the necessary files stored in the .\windows directory to the places where they will be used.
Is the stream-vfd driver supported on Windows?
Not at this time.
Can I use parallel HDF5 on Windows?
We do not currently support or test Parallel HDF5 on Windows due to lack of resources.
However, the configuration options do exist in the source for building Parallel HDF5 on Windows using CMake. Any questions or problems using CMake with Parallel HDF5 on Windows should be directed to the HDF-Forum. For joining or access to the HDF-Forum, see the Community Support page.
Can HDF5 run on cygwin?
HDF5 has been built successfully on cygwin. In HDF5 1.8, Fortran libraries are also supported. However, building shared libraries is not. Please see the details in the document INSTALL_Cygwin.txt on how to build and test HDF5 with cygwin.
Do you have examples of HDF5 applications?
Yes, we have C, C++, Fortran, High Level C, and High Level Fortran examples. Please look at the details in the section "How to build Examples (Optional)", from the INSTALL_Windows.txt document.
What compilers and platforms does HDF5 support?
Please see the RELEASE.txt file in the HDF5 source code for the most current information on the Windows compilers supported in HDF5.
I successfully build the new HDF5 library. When I use "hdf5test" to test the hdf5 DLL I find an enormous number of errors, including a crash. What was wrong?
It is likely that you forgot to copy libtestdll.dll or libtestddll.dll to your system directory. The HDF5 test suite relies on this DLL for its internal tests. We provide a batch file, install_dll.bat, to copy the necessary DLLs.
How can I make HDF5 1.8 backwards compatible with HDF5 1.6?
By default, HDF5 1.8 maps new macros to the new API versions that are being introduced with release 1.8.0. This means that C applications that worked with HDF 1.6.x, 1.8.0-beta3, or earlier, will not link with the HDF5 1.8.0 library unless you do the following:
- For any application that links with the HDF5 1.8. library, add the following
preprocessor definition:
H5_USE_16_API
This will force the library to use HDF5 1.6 macro definitions.
Also be aware that the use of new features of the HDF5 1.8.0 library can raise backward and forward compatibility issues that may affect your HDF5 files. Please see the Release 1.8.0 and Data Format Compatibility document in the Application Developer's Guide.
Building an application, I get unresolved external symbol H5T_NATIVE*_g errors.
If you are building an application using HDF5 DLLs, check to make sure you've defined
the preprocessor definition _HDF5USEDLL_.
When I link my Fortran application I get the error "Unresolved external symbol __imp__H5LIB_mp_H5OPEN_F@4 referenced in function _MAIN_".
This means that one of the HDF5 libraries isn't getting correctly linked. In the Fortran project settings, hdf5_fortran.lib should be specified as Linker input. (Or the hdf5_fortrand.lib for debug static, etc.).
If this doesn't fix it, try the verify the following project settings:
- In Fortran, Preprocessor Definitions,
HDF5F90_WINDOWSshould be specified. - In Fortran, Libraries, the "Runtime Library" must match your build configuration. That is, use "Debug Multithread DLL" if you are building debug version using hdf5_fortranddll.lib, etc.
If none of these suggestions help, try building some of the Windows Fortran example projects distributed with the source code. If you can build these, then linking your own application should be very similar.
When I build HDF5 with Cygwin, I get errors about 'time' or 'timezone'
The latest version of the Cygwin DLL has introduced new errors related to the globally-defined timezone variable. As a result, HDF5 1.6 or cannot currently be built with the latest version of Cygwin. We are currently working on a patch for HDF5 1.6 to workaround this bug. In the meantime, you may downgrade to a previous version of Cygwin and build HDF5 1.6 with it. Cygwin DLL version 1.5.24-2 is known to work with HDF5.
For HDF5 1.8, you can add "-ansi" to the CFLAGS, CXXFLAGS, and FCFLAGS environment variables to avoid this bug. For details please see the INSTALL_Cygwin.txt document.
When I test HDF5 with hdf5check.BAT, I get errors in 'fillval' test.
This is a known bug in the fillval test. In some instances, you may get failed output such as:
Testing chunked dataset extend
1770: Value read was not expected.
Elmt = {15, 19, 20, 9, 4}, read: 9999, expected: 1282470349
*FAILED*
at ..\..\..\test\fillval.c:1770 in test_extend_cases()...
*FAILED*
at ..\..\..\test\fillval.c:1916 in test_extend()...
This is an issue of the test, and can be ignored. The test uses random values in its input, so the failure is sporadic. You may re-test the fillval test manually, and you should not receive such an error again.
With .NET APIs get "The specified module could not be found."
In Visual Studio:
-
Check the solution explorer to be sure that HDF5DotNet is listed under References. If it is not, right click the word "References", select "Add Reference", click the tab labeled "Browse" and find the HDF5DotNet.dll file in the HDF5DotNet Debug directory.
Also check:
Project | CSharpExample1 PropertiesSelect the "Reference Paths" tab and add the folder containing the HDF5DotNet.dll file.
- Be sure that you have hdf5dll.dll and HDF5DotNet.dll.
Note that the .NET APIs is a prototype and has not been tested on Vista.
