Contents
General Information
- Do you provide multithreaded version so that I can use in my MFC application?
- 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?
- When linking my application with HDF, I get the error "LIBC.lib : error LNK2005: _exit already defined in MSVCRT.lib(MSVCRT.dll)"
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 does HDF5 support?
- What Windows 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."
Do you provide multithreaded version so that I can use in my MFC application?
The HDF group provides a Multi-threaded DLL in the binary distributions. However, it is fairly easy to build your own multi-threaded static version of HDF5 the library, if needed. Please see the details in the section, "How to build Multi-threaded version of the HDF5 library", of the document, INSTALL_WINDOWS.txt.
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.
One tip for applications that use MS Visual Studio 6.0: don't use the C symbol off_t; it is limited to 32-bits (4GB). Use longlong or SetFilePointer instead.
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. If you need to use the MFC, use the multithreaded-static library. We do not provide these binaries, however, so you will have to obtain the source code and build it yourself.
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?
We provide many different Windows binaries for libjpeg, zlib, and szip. Each package corresponds to a different compiler or platform, and it is important that you use the correct one.
You can find all of our external library binaries here. The README document in each "windows" subdirectory provides details about each package.
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."
If you are getting a similar error that is causing the build to fail, you may have a problem with runtime libraries. Please see the related question below.
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).
Also, our libraries were built using the single-threaded run time option. Go to Project, Settings, C/C++ and select "Code Generation" under Category. Make sure that the "Single-Threaded" option is set under "Use run-time library".
If nothing else works, you can build the libraries from source yourself.
When linking my application with HDF, I get the error "LIBC.lib : error LNK2005: _exit already defined in MSVCRT.lib(MSVCRT.dll)"
This is a conflict between LIBC.lib and MSVCRT.lib-- LIBC.lib refers to the single-threaded release runtime library in VS 6.0, and MSVCRT.lib, multithreaded release.
Visual Studio requires that all libraries inside a project are linked with the same runtime library.
To resolve this conflict, you must build the HDF5 libraries using multithreaded runtime libraries. The process is described in the document INSTALL_Windows.txt , under the heading "How to build Multi-threaded version of HDF(4/5) library."
For more information, also see: http://support.microsoft.com/kb/154753
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.
Alternatively, a patch has been released and is available here, which has been updated with the "ohdr_gentst" project disabled. Simply unzip the patch into your HDF5 source directory, and replace the existing solution files with the new ones.
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?
No, we currently do not support parallel HDF5 on Windows.
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 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.
What Windows platforms does HDF5 support?
We currently support 32- and 64-bit Windows XP and Vista. Please see the above table for details.
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. The following document describes these issues in detail:
http://www.hdfgroup.uiuc.edu/HDF5/doc_1.8pre/doc/ADGuide/CompatFormat180.html
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.
