You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
without explicitly typing --with-hdf4 in gdal configure, it will detect the host system /usr/include/hdf/hdfi.h lib, this will cause incompatibility since it cannot find sys\types.h and sys\stat.h (with back-slash), hdf code assumes its not compiling in Linux/Unix host.
this is the build error:
In file included from /usr/include/hdf/hdf.h:20:0,
from /usr/include/hdf/mfhdf.h:27,
from EHapi.c:20:
/usr/include/hdf/hdfi.h:595:0: warning: ignoring #pragma comment [-Wunknown-pragmas]
#pragma comment( lib, "oldnames" )
^
In file included from /usr/include/hdf/hdf.h:20:0,
from /usr/include/hdf/mfhdf.h:27,
from EHapi.c:20:
/usr/include/hdf/hdfi.h:604:58: fatal error: sys\types.h: No such file or directory
compilation terminated.
make[5]: *** [../../o/EHapi.lo] Error 1
this is the /usr/include/hdf/hdfi.h implementation that causes the error(Line:600):
#ifdefUNIX386#include<sys/types.h>/* for unbuffered file I/O */#include<sys/stat.h>#include<unistd.h>#else/* !UNIX386 */#include<sys\types.h>/* for unbuffered file I/O */#include<sys\stat.h>#include<io.h>#include<conio.h>/* for debugging getch() calls */#include<malloc.h>#endif/* UNIX386 */
as you can see, the #UNIX386 macro does not seem to be defined and it assumes compilation on other system, which causes fail to detect proper library.
we need to specify an option in mxe/src/gdal.mk to find the patched libraries from mxe/usr/i686-w64-mingw32.static/include, which will lead into successful build without error:
without explicitly typing --with-hdf4 in gdal configure, it will detect the host system /usr/include/hdf/hdfi.h lib, this will cause incompatibility since it cannot find sys\types.h and sys\stat.h (with back-slash), hdf code assumes its not compiling in Linux/Unix host.
this is the build error:
this is the /usr/include/hdf/hdfi.h implementation that causes the error(Line:600):
as you can see, the #UNIX386 macro does not seem to be defined and it assumes compilation on other system, which causes fail to detect proper library.
the correct way is to adapt the latest hdf4 compatibility patches, suggested in src/hdf4-1-portability-fixes.patch:
https://github.com/marlam/mxe/blob/master/src/hdf4-1-portability-fixes.patch
we need to specify an option in mxe/src/gdal.mk to find the patched libraries from mxe/usr/i686-w64-mingw32.static/include, which will lead into successful build without error:
further info:
The text was updated successfully, but these errors were encountered: