I am trying to compile "xz-5.2.1" in MinGW/MSYS environment. I see the following errors:
#error UINT32_C is not defined and unsigned int is not 32-bit.
error: #error size_t is not 32-bit or 64-bit
I am not familiar with MinGW, could anyone shed some light on this? It looks like some macro definition are missing. Some header file missing?
ADD 1
The commands I used to compile the xz-5.2.1 are:
./configure
./make
The error screenshot:
Some background, I am following this link to compile the Tesseract-OCR library. And this is just one of the steps.
ADD 2
Based on the error message, I checked the sysdefs.h
file. It contains the following content:
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
The above make
output contains the -DHAVE_CONFIG_H
, so I think the system header file <config.h>
should be included.
But strange enough, I searched the C:\MinGW\include
, there's no such file. So I GUESS this may have caused the undefined UINT_MAX
warning at line 57. And then the UINT32_C is not defined
error at line 58.
But I don't know why the system header file config.h
is missing and where to get it.
ADD 3
I dig a bit about the GNU autotools
. And luckily enough I find that the following commands can carry on my build process: (Though I am still not very sure why it works. All I know is that it may be related to portability.)
autoheader (this generates the config.h.in file)
./Configure (this generates the config.h file from the config.h.in file)
And now, my build process is blocked by another issue as below:
It seems this is a known issue. And another thread has addressed it.
(I will continue update with my progress.)