Cannot compile VTK using MinGW
Trying to compile VTK 7.1.0 with the Qt supplied MinGW (5.3-32bit) on Windows 10 (64bit) halts at the libtiff library with:
[ 43%] Building C object ThirdParty/tiff/vtktiff/libtiff/CMakeFiles/vtktiff.dir/tif_aux.c.obj
cd /d D:\Users\ezzkc\Build\VTK-7.1.0\build-mingw32\ThirdParty\tiff\vtktiff\libtiff && C:\Qt\Tools\mingw530_32\bin\gcc.exe -DVTK_IN_VTK -Dvtktiff_EXPORTS @CMakeFiles/vtktiff.dir/includes_C.rsp -mwin32 -mthreads -w -w -Wall -Winline -W -Wformat-security -Wpointer-arith -Wdisabled-optimization -Wno-unknown-pragmas -Wdeclaration-after-statement -fstrict-aliasing -g -o CMakeFiles\vtktiff.dir\tif_aux.c.obj -c D:\Users\ezzkc\Build\VTK-7.1.0\ThirdParty\tiff\vtktiff\libtiff\tif_aux.c
In file included from C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/io.h:169:0,
from C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/fcntl.h:8,
from D:\Users\ezzkc\Build\VTK-7.1.0\ThirdParty\tiff\vtktiff\libtiff\tiffiop.h:36,
from D:\Users\ezzkc\Build\VTK-7.1.0\ThirdParty\tiff\vtktiff\libtiff\tif_aux.c:32:
C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/_mingw_off_t.h:23:55: error: operator '==' has no left operand
The GCC specific variable is conditionally defined in the CMakeLists.txt that can be found in the libtiff directory, but this branch is only chosen when the CMake variable UNIX is true (which it isn't on MinGW under Windows if I understand correctly). Also running mingw32-make VERBOSE=1
does not show this flag on the compile line.
The line in _mingw_ff_t.h
the error message refers to is:
20: #ifndef _FILE_OFFSET_BITS_SET_OFFT
21: #define _FILE_OFFSET_BITS_SET_OFFT
22: #if !defined(NO_OLDNAMES) || defined(_POSIX)
23: #if (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64))
24:typedef off64_t off_t;
25: #else
26: typedef off32_t off_t;
27: #endif /* #if !defined(NO_OLDNAMES) || defined(_POSIX) */
28: #endif /* (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)) */
29: #endif /* _FILE_OFFSET_BITS_SET_OFFT */