I'm compiling tesseract-ocr-3.01 in MinGW, and I'm getting this error ambigs.cpp:31:22: fatal error: strtok_r.h: No such file or directory
This is the code where the error is:
#ifdef WIN32
#ifndef __GNUC__
#define strtok_r strtok_s
#else
#include "strtok_r.h"
#endif /* __GNUC__ */
#endif /* WIN32 */
Edit
I found this feature request to add strtok_r.h to MinGW. From the comments there:
strtok_r() is an optional POSIX function, required only for implementations which support POSIX threads. MinGW does not support POSIX threads; therefore, I don't think that this function has any place in a base MinGW distribution.
POSIX threads support for MS-Windows is provided by the pthreads-win32 project. Maybe they already provide a strtok_r() implementation. If so, then you could use it; if not, you might ask them to consider adding it.
The problem is most easily solved by adding an strtok_r implementation to the project's sources: