ocrclass.h:117:18: error: field ‘end_time‘ has incomplete type ‘timeval‘

时间:2024-03-29 13:01:13

Alpine Linux v3.5上安装  tesseract-4.1.1

报错:

缺少timeval函数

ocrclass.h:117:18: error: field 'end_time' has incomplete type 'timeval'

Current Behavior:

In file included from control.cpp:37:0:
../../src/ccutil/ocrclass.h:117:18: error: field 'end_time' has incomplete type 'timeval'
   struct timeval end_time;

The 'timeval' seems to be part of WIN32 as per

#ifdef _WIN32
#include <winsock2.h> // for timeval

Expected Behavior:

It builds.

Suggested Fix:

There is already a fix in place which is not part of the 4.1.0 release. see 

替换这个文件 

  1. tesseract
  2. /src
  3. /ccutil

/

ocrclass.h

https://github.com/tesseract-ocr/tesseract/commit/1948f0d520b712e13820acc28024f949dead2b01?diff=unified&w=0