undefinedreference to 'ftruncated64'
(I build with configure, not cmake.)
I checked the code, there is an define H5_HAVE_MINGW that must be set.
Should H5_HAVE_WIN32_API also be set for MinGW ? I gather it *should* be defined, but I don't know whether it is. How do I check ?
Similarly, how do I tell whether H5_HAVE_MINGW is defined for my build ?
"H5_HAVE_MINGW" is a bit of a mystery - I can't find it in any of the source header files, and the only src/*.c file that references it is H5FDstdio.c.
In that file we find:
#define file_fseek _fseeki64
#define file_offset_t __int64
#define file_ftruncate _chsize_s /* Supported in VS 2005 or newer */
#define file_ftell _ftelli64
#endif /* H5_HAVE_MINGW */
#endif /* H5_HAVE_WIN32_API */
Quite clearly, if we're running MinGW then the intention is that none of those defines should be set - and I find that none of those defines are set. So that part is fine. (Mind you, I presently don't know if they're unset because H5_HAVE_WIN32_API is not defined for me, or because H5_HAVE_MINGW *is* defined for me.)
The problem with H5FDstdio.c occurs in the very next block of defines:
#define file_fseek fseeko64
#define file_offset_t off64_t
#define file_ftruncate ftruncate64
#define file_ftell ftello64
#define file_fseek fseeko
#define file_offset_t off_t
#define file_ftruncate ftruncate
#define file_ftell ftello
#endif /* H5_HAVE_FSEEKO64 */
#endif /* file_fseek */
It assumes that if H5_HAVE_FSEEKO64 is defined, then H5_HAVE_FTRUNCATE64 is also defined.
The assumption is correct for my 64-bit MinGW (gcc-4.7.0), but not for my 32-bit MinGW (gcc-4.5.2).
Similarly, both H5FDdirect.c and H5FDmpiposix.c assume that if H5_HAVE_LSEEK64 is defined, then H5_HAVE_FTRUNCATE64 is also defined - which is again true for my 64-bit MinGW, but not for my 32-bit MinGW.
----- Original Message ----- From: "Allen D Byrne" <firstname.lastname@example.org>
Cc: "Sisyphus" <email@example.com>
Sent: Tuesday, April 24, 2012 11:41 PM
Subject: Re: [Hdf-forum] Problems compiling hdf5 under MingW: