Skip to content

Compile Tesseract-OCR for Android ARM64 use x86_64-linux-gnu headers #4490

@pol2095

Description

@pol2095

Hello,

When I configure a Tesseract-OCR project for Android arm64-v8a on Ubuntu, I use the following settings :

set(CMAKE_TOOLCHAIN_FILE /home/user/SDKs/android_ndk/android_ndk_clang/build/cmake/android.toolchain.cmake)
set(ANDROID_ABI arm64-v8a)
set(ANDROID_PLATFORM 26) 
set(ANDROID_STL c++_shared)

I receive this message using make command:

/usr/include/x86_64-linux-gnu/sys/cdefs.h:64:6: error: function-like macro '__GNUC_PREREQ' is not defined
    64 | # if __GNUC_PREREQ (4, 6) && !defined _LIBC
       |      ^
/usr/include/x86_64-linux-gnu/sys/cdefs.h:78:10: error: function-like macro '__GNUC_PREREQ' is not defined
    78 |      && (__GNUC_PREREQ (3, 4) || __glibc_has_attribute
(__nothrow__))
       |          ^
/usr/include/x86_64-linux-gnu/sys/cdefs.h:84:31: error: function-like macro '__GNUC_PREREQ' is not defined
    84 | #  if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4)
       |

I don't understand why Tesseract-OCR for Android ARM64 use x86_64-linux-gnu headers instead of Android NDK headers ?
How I can solve this behavior ?
Thanks

Operating System

Linux Ubuntu 24.04 LTS

Compiler

Clang++ Android NDK r29

CPU

x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions