Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Errors when compiling on mac with OCR (Leptonica) #1625

Open
superbonaci opened this issue Jul 12, 2024 · 3 comments
Open

[BUG] Errors when compiling on mac with OCR (Leptonica) #1625

superbonaci opened this issue Jul 12, 2024 · 3 comments

Comments

@superbonaci
Copy link
Contributor

Latest commit f12f12b

This works well, no messages:

pkg-config --exists --print-errors tesseract
pkg-config --exists --print-errors lept

Compiling with OCR works but with errors:

% ./build.command OCR
Obtaining Git commit
Storing variables in file
Commit: f12f12b9165c83d59e6ec43876ae8701dd354cf6
Date: 2024-07-12
Stored all in compile_info_real.h
Done.
In file included from ../src/ccextractor.c:6:
../src/ccextractor.h:10:10: fatal error: 'leptonica/allheaders.h' file not found
#include <leptonica/allheaders.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from ../src/lib_ccx/ccx_encoders_srt.c:7:
../src/ccextractor.h:10:10: fatal error: 'leptonica/allheaders.h' file not found
#include <leptonica/allheaders.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from ../src/lib_ccx/ccx_decoders_xds.c:1:
../src/lib_ccx/ccx_decoders_xds.h:15:6: warning: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent definition [-Wdeprecated-non-prototype]
void xds_cea608_test();
     ^
../src/lib_ccx/ccx_decoders_xds.c:204:6: note: conflicting prototype is here
void xds_cea608_test(struct ccx_decoders_xds_context *ctx, struct cc_subtitle *sub)
     ^
1 warning generated.
In file included from ../src/lib_ccx/ccx_encoders_common.c:10:
../src/ccextractor.h:10:10: fatal error: 'leptonica/allheaders.h' file not found
#include <leptonica/allheaders.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
../src/lib_ccx/ts_functions.c:88:47: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
        printf("Packet start code prefix: %04lx # ", pes_prefix);
                                          ~~~~~      ^~~~~~~~~~
                                          %04llx
1 warning generated.
../src/lib_ccx/telxcc.c:1350:48: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                printf("Packet start code prefix: %04lx # ", pes_prefix);
                                                  ~~~~~      ^~~~~~~~~~
                                                  %04llx
1 warning generated.
../src/lib_ccx/ccx_encoders_webvtt.c:219:4: warning: format specifies type 'long' but the argument has type 'LLONG' (aka 'long long') [-Wformat]
                        context->timing->sync_pts2fts_pts, h1, m1, s1, ms1,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
  __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
                                                       ^~~~~~~~~~~
1 warning generated.
../src/lib_ccx/params.c:21:10: fatal error: 'leptonica/allheaders.h' file not found
#include <leptonica/allheaders.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from ../src/lib_ccx/zvbi/sampling_par.c:26:
../src/lib_ccx/zvbi/misc.h:371:11: warning: 'strlcpy' macro redefined [-Wmacro-redefined]
#  define strlcpy _vbi_strlcpy
          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:111:9: note: previous definition is here
#define strlcpy(dest, ...) \
        ^
1 warning generated.
In file included from ../src/lib_ccx/zvbi/raw_decoder.c:29:
../src/lib_ccx/zvbi/misc.h:371:11: warning: 'strlcpy' macro redefined [-Wmacro-redefined]
#  define strlcpy _vbi_strlcpy
          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:111:9: note: previous definition is here
#define strlcpy(dest, ...) \
        ^
../src/lib_ccx/zvbi/raw_decoder.c:1038:13: warning: implicit conversion from enumeration type 'const vbi_modulation' to different enumeration type 'vbi3_modulation' [-Wenum-conversion]
                     par->modulation)) {
                     ~~~~~^~~~~~~~~~
2 warnings generated.
In file included from ../src/lib_ccx/zvbi/bit_slicer.c:24:
../src/lib_ccx/zvbi/misc.h:371:11: warning: 'strlcpy' macro redefined [-Wmacro-redefined]
#  define strlcpy _vbi_strlcpy
          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:111:9: note: previous definition is here
#define strlcpy(dest, ...) \
        ^
1 warning generated.
In file included from ../src/lib_ccx/zvbi/decoder.c:30:
../src/lib_ccx/zvbi/misc.h:371:11: warning: 'strlcpy' macro redefined [-Wmacro-redefined]
#  define strlcpy _vbi_strlcpy
          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:111:9: note: previous definition is here
#define strlcpy(dest, ...) \
        ^
1 warning generated.
In file included from ../src/lib_ccx/output.c:2:
../src/ccextractor.h:10:10: fatal error: 'leptonica/allheaders.h' file not found
#include <leptonica/allheaders.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
../src/lib_ccx/ocr.c:6:10: fatal error: 'leptonica/allheaders.h' file not found
#include <leptonica/allheaders.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
../src/thirdparty/zlib/inflate.c:105:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local int inflateStateCheck(strm)
          ^
../src/thirdparty/zlib/inflate.c:119:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateResetKeep(strm)
            ^
../src/thirdparty/zlib/inflate.c:144:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateReset(strm)
            ^
../src/thirdparty/zlib/inflate.c:157:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateReset2(strm, windowBits)
            ^
../src/thirdparty/zlib/inflate.c:195:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
            ^
../src/thirdparty/zlib/inflate.c:239:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateInit_(strm, version, stream_size)
            ^
../src/thirdparty/zlib/inflate.c:247:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflatePrime(strm, bits, value)
            ^
../src/thirdparty/zlib/inflate.c:278:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void fixedtables(state)
           ^
../src/thirdparty/zlib/inflate.c:396:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local int updatewindow(strm, end, copy)
          ^
../src/thirdparty/zlib/inflate.c:622:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflate(strm, flush)
            ^
../src/thirdparty/zlib/inflate.c:1277:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateEnd(strm)
            ^
../src/thirdparty/zlib/inflate.c:1291:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength)
            ^
../src/thirdparty/zlib/inflate.c:1314:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
            ^
../src/thirdparty/zlib/inflate.c:1349:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateGetHeader(strm, head)
            ^
../src/thirdparty/zlib/inflate.c:1377:16: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local unsigned syncsearch(have, buf, len)
               ^
../src/thirdparty/zlib/inflate.c:1400:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateSync(strm)
            ^
../src/thirdparty/zlib/inflate.c:1451:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateSyncPoint(strm)
            ^
../src/thirdparty/zlib/inflate.c:1461:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateCopy(dest, source)
            ^
../src/thirdparty/zlib/inflate.c:1508:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateUndermine(strm, subvert)
            ^
../src/thirdparty/zlib/inflate.c:1526:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateValidate(strm, check)
            ^
../src/thirdparty/zlib/inflate.c:1541:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
long ZEXPORT inflateMark(strm)
             ^
../src/thirdparty/zlib/inflate.c:1554:23: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
unsigned long ZEXPORT inflateCodesUsed(strm)
                      ^
22 warnings generated.
../src/thirdparty/zlib/compress.c:22:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
            ^
../src/thirdparty/zlib/compress.c:68:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT compress (dest, destLen, source, sourceLen)
            ^
../src/thirdparty/zlib/compress.c:81:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
uLong ZEXPORT compressBound (sourceLen)
              ^
3 warnings generated.
../src/thirdparty/zlib/deflate.c:201:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void slide_hash(s)
           ^
../src/thirdparty/zlib/deflate.c:228:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT deflateInit_(strm, level, version, stream_size)
            ^
../src/thirdparty/zlib/deflate.c:240:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
            ^
../src/thirdparty/zlib/deflate.c:353:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local int deflateStateCheck (strm)
          ^
../src/thirdparty/zlib/deflate.c:376:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
            ^
../src/thirdparty/zlib/deflate.c:445:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength)
            ^
../src/thirdparty/zlib/deflate.c:467:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT deflateResetKeep (strm)
            ^
../src/thirdparty/zlib/deflate.c:505:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT deflateReset (strm)
            ^
../src/thirdparty/zlib/deflate.c:517:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT deflateSetHeader (strm, head)
            ^
../src/thirdparty/zlib/deflate.c:528:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT deflatePending (strm, pending, bits)
            ^
../src/thirdparty/zlib/deflate.c:542:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT deflatePrime (strm, bits, value)
            ^
../src/thirdparty/zlib/deflate.c:568:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT deflateParams(strm, level, strategy)
            ^
../src/thirdparty/zlib/deflate.c:617:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
            ^
../src/thirdparty/zlib/deflate.c:652:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
uLong ZEXPORT deflateBound(strm, sourceLen)
              ^
../src/thirdparty/zlib/deflate.c:716:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void putShortMSB (s, b)
           ^
../src/thirdparty/zlib/deflate.c:730:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void flush_pending(strm)
           ^
../src/thirdparty/zlib/deflate.c:763:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT deflate (strm, flush)
            ^
../src/thirdparty/zlib/deflate.c:1076:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT deflateEnd (strm)
            ^
../src/thirdparty/zlib/deflate.c:1102:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT deflateCopy (dest, source)
            ^
../src/thirdparty/zlib/deflate.c:1164:16: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local unsigned read_buf(strm, buf, size)
               ^
../src/thirdparty/zlib/deflate.c:1194:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void lm_init (s)
           ^
../src/thirdparty/zlib/deflate.c:1236:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local uInt longest_match(s, cur_match)
           ^
../src/thirdparty/zlib/deflate.c:1482:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void fill_window(s)
           ^
../src/thirdparty/zlib/deflate.c:1643:19: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local block_state deflate_stored(s, flush)
                  ^
../src/thirdparty/zlib/deflate.c:1824:19: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local block_state deflate_fast(s, flush)
                  ^
../src/thirdparty/zlib/deflate.c:1926:19: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local block_state deflate_slow(s, flush)
                  ^
../src/thirdparty/zlib/deflate.c:2057:19: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local block_state deflate_rle(s, flush)
                  ^
../src/thirdparty/zlib/deflate.c:2130:19: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local block_state deflate_huff(s, flush)
                  ^
28 warnings generated.
../src/thirdparty/zlib/gzread.c:21:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local int gz_load(state, buf, len, have)
          ^
../src/thirdparty/zlib/gzread.c:56:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local int gz_avail(state)
          ^
../src/thirdparty/zlib/gzread.c:91:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local int gz_look(state)
          ^
../src/thirdparty/zlib/gzread.c:175:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local int gz_decomp(state)
          ^
../src/thirdparty/zlib/gzread.c:229:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local int gz_fetch(state)
          ^
../src/thirdparty/zlib/gzread.c:259:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local int gz_skip(state, len)
          ^
../src/thirdparty/zlib/gzread.c:294:16: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local z_size_t gz_read(state, buf, len)
               ^
../src/thirdparty/zlib/gzread.c:375:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzread(file, buf, len)
            ^
../src/thirdparty/zlib/gzread.c:411:18: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
z_size_t ZEXPORT gzfread(buf, size, nitems, file)
                 ^
../src/thirdparty/zlib/gzread.c:447:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzgetc(file)
            ^
../src/thirdparty/zlib/gzread.c:476:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzgetc_(file)
            ^
../src/thirdparty/zlib/gzread.c:483:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzungetc(c, file)
            ^
../src/thirdparty/zlib/gzread.c:543:16: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
char * ZEXPORT gzgets(file, buf, len)
               ^
../src/thirdparty/zlib/gzread.c:607:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzdirect(file)
            ^
../src/thirdparty/zlib/gzread.c:627:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzclose_r(file)
            ^
15 warnings generated.
../src/thirdparty/zlib/crc32.c:202:23: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
unsigned long ZEXPORT crc32_z(crc, buf, len)
                      ^
../src/thirdparty/zlib/crc32.c:237:23: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
unsigned long ZEXPORT crc32(crc, buf, len)
                      ^
../src/thirdparty/zlib/crc32.c:266:21: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local unsigned long crc32_little(crc, buf, len)
                    ^
../src/thirdparty/zlib/crc32.c:306:21: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local unsigned long crc32_big(crc, buf, len)
                    ^
../src/thirdparty/zlib/crc32.c:344:21: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local unsigned long gf2_matrix_times(mat, vec)
                    ^
../src/thirdparty/zlib/crc32.c:361:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void gf2_matrix_square(square, mat)
           ^
../src/thirdparty/zlib/crc32.c:372:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local uLong crc32_combine_(crc1, crc2, len2)
            ^
../src/thirdparty/zlib/crc32.c:428:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
uLong ZEXPORT crc32_combine(crc1, crc2, len2)
              ^
../src/thirdparty/zlib/crc32.c:436:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
              ^
9 warnings generated.
../src/thirdparty/zlib/infback.c:28:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size)
            ^
../src/thirdparty/zlib/infback.c:82:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void fixedtables(state)
           ^
../src/thirdparty/zlib/infback.c:250:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc)
            ^
../src/thirdparty/zlib/infback.c:631:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT inflateBackEnd(strm)
            ^
4 warnings generated.
../src/thirdparty/zlib/zutil.c:133:22: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
const char * ZEXPORT zError(err)
                     ^
../src/thirdparty/zlib/zutil.c:305:22: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
                     ^
../src/thirdparty/zlib/zutil.c:315:20: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
void ZLIB_INTERNAL zcfree (opaque, ptr)
                   ^
3 warnings generated.
../src/thirdparty/zlib/gzlib.c:75:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void gz_reset(state)
           ^
../src/thirdparty/zlib/gzlib.c:91:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local gzFile gz_open(path, fd, mode)
             ^
../src/thirdparty/zlib/gzlib.c:270:16: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
gzFile ZEXPORT gzopen(path, mode)
               ^
../src/thirdparty/zlib/gzlib.c:278:16: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
gzFile ZEXPORT gzopen64(path, mode)
               ^
../src/thirdparty/zlib/gzlib.c:286:16: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
gzFile ZEXPORT gzdopen(fd, mode)
               ^
../src/thirdparty/zlib/gzlib.c:316:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzbuffer(file, size)
            ^
../src/thirdparty/zlib/gzlib.c:343:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzrewind(file)
            ^
../src/thirdparty/zlib/gzlib.c:366:19: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
z_off64_t ZEXPORT gzseek64(file, offset, whence)
                  ^
../src/thirdparty/zlib/gzlib.c:443:17: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
z_off_t ZEXPORT gzseek(file, offset, whence)
                ^
../src/thirdparty/zlib/gzlib.c:455:19: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
z_off64_t ZEXPORT gztell64(file)
                  ^
../src/thirdparty/zlib/gzlib.c:472:17: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
z_off_t ZEXPORT gztell(file)
                ^
../src/thirdparty/zlib/gzlib.c:482:19: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
z_off64_t ZEXPORT gzoffset64(file)
                  ^
../src/thirdparty/zlib/gzlib.c:505:17: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
z_off_t ZEXPORT gzoffset(file)
                ^
../src/thirdparty/zlib/gzlib.c:515:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzeof(file)
            ^
../src/thirdparty/zlib/gzlib.c:532:22: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
const char * ZEXPORT gzerror(file, errnum)
                     ^
../src/thirdparty/zlib/gzlib.c:553:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
void ZEXPORT gzclearerr(file)
             ^
../src/thirdparty/zlib/gzlib.c:579:20: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
void ZLIB_INTERNAL gz_error(state, err, msg)
                   ^
17 warnings generated.
../src/thirdparty/zlib/inftrees.c:32:19: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
                  ^
1 warning generated.
../src/thirdparty/zlib/uncompr.c:27:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT uncompress2 (dest, destLen, source, sourceLen)
            ^
../src/thirdparty/zlib/uncompr.c:86:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT uncompress (dest, destLen, source, sourceLen)
            ^
2 warnings generated.
../src/thirdparty/zlib/gzwrite.c:17:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local int gz_init(state)
          ^
../src/thirdparty/zlib/gzwrite.c:73:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local int gz_comp(state, flush)
          ^
../src/thirdparty/zlib/gzwrite.c:145:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local int gz_zero(state, len)
          ^
../src/thirdparty/zlib/gzwrite.c:178:16: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local z_size_t gz_write(state, buf, len)
               ^
../src/thirdparty/zlib/gzwrite.c:246:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzwrite(file, buf, len)
            ^
../src/thirdparty/zlib/gzwrite.c:274:18: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
z_size_t ZEXPORT gzfwrite(buf, size, nitems, file)
                 ^
../src/thirdparty/zlib/gzwrite.c:304:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzputc(file, c)
            ^
../src/thirdparty/zlib/gzwrite.c:352:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzputs(file, str)
            ^
../src/thirdparty/zlib/gzwrite.c:553:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzflush(file, flush)
            ^
../src/thirdparty/zlib/gzwrite.c:585:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzsetparams(file, level, strategy)
            ^
../src/thirdparty/zlib/gzwrite.c:627:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzclose_w(file)
            ^
11 warnings generated.
../src/thirdparty/zlib/trees.c:379:20: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
void ZLIB_INTERNAL _tr_init(s)
                   ^
../src/thirdparty/zlib/trees.c:407:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void init_block(s)
           ^
../src/thirdparty/zlib/trees.c:451:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void pqdownheap(s, tree, k)
           ^
../src/thirdparty/zlib/trees.c:486:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void gen_bitlen(s, desc)
           ^
../src/thirdparty/zlib/trees.c:572:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void gen_codes (tree, max_code, bl_count)
           ^
../src/thirdparty/zlib/trees.c:615:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void build_tree(s, desc)
           ^
../src/thirdparty/zlib/trees.c:703:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void scan_tree (s, tree, max_code)
           ^
../src/thirdparty/zlib/trees.c:748:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void send_tree (s, tree, max_code)
           ^
../src/thirdparty/zlib/trees.c:799:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local int build_bl_tree(s)
          ^
../src/thirdparty/zlib/trees.c:834:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void send_all_trees(s, lcodes, dcodes, blcodes)
           ^
../src/thirdparty/zlib/trees.c:863:20: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
                   ^
../src/thirdparty/zlib/trees.c:886:20: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
void ZLIB_INTERNAL _tr_flush_bits(s)
                   ^
../src/thirdparty/zlib/trees.c:896:20: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
void ZLIB_INTERNAL _tr_align(s)
                   ^
../src/thirdparty/zlib/trees.c:911:20: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
                   ^
../src/thirdparty/zlib/trees.c:1014:19: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZLIB_INTERNAL _tr_tally (s, dist, lc)
                  ^
../src/thirdparty/zlib/trees.c:1064:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void compress_block(s, ltree, dtree)
           ^
../src/thirdparty/zlib/trees.c:1124:11: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local int detect_data_type(s)
          ^
../src/thirdparty/zlib/trees.c:1158:16: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local unsigned bi_reverse(code, len)
               ^
../src/thirdparty/zlib/trees.c:1173:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void bi_flush(s)
           ^
../src/thirdparty/zlib/trees.c:1190:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local void bi_windup(s)
           ^
20 warnings generated.
../src/thirdparty/zlib/gzclose.c:11:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
int ZEXPORT gzclose(file)
            ^
1 warning generated.
../src/thirdparty/zlib/inffast.c:50:20: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
void ZLIB_INTERNAL inflate_fast(strm, start)
                   ^
1 warning generated.
../src/thirdparty/zlib/adler32.c:63:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
uLong ZEXPORT adler32_z(adler, buf, len)
              ^
../src/thirdparty/zlib/adler32.c:134:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
uLong ZEXPORT adler32(adler, buf, len)
              ^
../src/thirdparty/zlib/adler32.c:143:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
local uLong adler32_combine_(adler1, adler2, len2)
            ^
../src/thirdparty/zlib/adler32.c:172:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
              ^
../src/thirdparty/zlib/adler32.c:180:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
              ^
5 warnings generated.
@superbonaci
Copy link
Contributor Author

superbonaci commented Jul 12, 2024

Leptonica is located here:

% brew list leptonica
/opt/homebrew/Cellar/leptonica/1.84.1/bin/convertfilestopdf
/opt/homebrew/Cellar/leptonica/1.84.1/bin/convertfilestops
/opt/homebrew/Cellar/leptonica/1.84.1/bin/convertformat
/opt/homebrew/Cellar/leptonica/1.84.1/bin/convertsegfilestopdf
/opt/homebrew/Cellar/leptonica/1.84.1/bin/convertsegfilestops
/opt/homebrew/Cellar/leptonica/1.84.1/bin/converttopdf
/opt/homebrew/Cellar/leptonica/1.84.1/bin/converttops
/opt/homebrew/Cellar/leptonica/1.84.1/bin/fileinfo
/opt/homebrew/Cellar/leptonica/1.84.1/bin/imagetops
/opt/homebrew/Cellar/leptonica/1.84.1/bin/xtractprotos
/opt/homebrew/Cellar/leptonica/1.84.1/include/leptonica/ (36 files)
/opt/homebrew/Cellar/leptonica/1.84.1/lib/libleptonica.6.dylib
/opt/homebrew/Cellar/leptonica/1.84.1/lib/cmake/ (2 files)
/opt/homebrew/Cellar/leptonica/1.84.1/lib/pkgconfig/lept.pc
/opt/homebrew/Cellar/leptonica/1.84.1/lib/ (2 other files)

build.command has to include:

  • Set the CFLAGS and LDFLAGS environment variables to include the paths to the Leptonica headers and libraries.
  • Add the include path for Leptonica directly to the BLD_INCLUDE variable.
  • Ensure that the linker paths are set correctly in BLD_LINKER.
#!/bin/bash
cd `dirname $0`

# Set the include and library paths for Leptonica
export CFLAGS="-I/opt/homebrew/Cellar/leptonica/1.84.1/include"
export LDFLAGS="-L/opt/homebrew/Cellar/leptonica/1.84.1/lib"

BLD_FLAGS="-std=gnu99 -Wno-write-strings -Wno-pointer-sign -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP -DDISABLE_RUST"
[[ $1 = "OCR" ]] && BLD_FLAGS="$BLD_FLAGS -DENABLE_OCR"

# Explicitly add Leptonica include path
BLD_INCLUDE="-I../src/ -I../src/lib_ccx -I../src/lib_hash -I../src/thirdparty/libpng -I../src/thirdparty -I../src/thirdparty/protobuf-c -I../src/thirdparty/zlib -I../src/thirdparty/freetype/include -I/opt/homebrew/Cellar/leptonica/1.84.1/include `pkg-config --cflags --silence-errors gpac`"
[[ $1 = "OCR" ]] && BLD_INCLUDE="$BLD_INCLUDE `pkg-config --cflags --silence-errors tesseract`"

SRC_CCX="$(find ../src/lib_ccx -name '*.c')"

Seems to work now.

@superbonaci superbonaci changed the title [BUG] Errors when compiling on mac [BUG] Errors when compiling on mac (Leptonica) Jul 12, 2024
@superbonaci superbonaci changed the title [BUG] Errors when compiling on mac (Leptonica) [BUG] Errors when compiling on mac with OCR (Leptonica) Jul 12, 2024
@g-30
Copy link

g-30 commented Aug 26, 2024

Can't compile. Here's the error that I see:

==> ./build.command OCR
Last 15 lines from /Users/user/Library/Logs/Homebrew/ccextractor/01.build.command:
    struct Box        *mediabox;     /*!< bounding region for all images      */
           ^
../src/lib_ccx/ocr.c:430:41: error: incomplete definition of type 'struct Box'
                                                        histogram[copy->data[(crop_points->y + i) * w + (crop_points->x + j)]]++;
                                                                              ~~~~~~~~~~~^
/opt/homebrew/include/leptonica/imageio.h:241:12: note: forward declaration of 'struct Box'
    struct Box        *mediabox;     /*!< bounding region for all images      */
           ^
../src/lib_ccx/ocr.c:430:68: error: incomplete definition of type 'struct Box'
                                                        histogram[copy->data[(crop_points->y + i) * w + (crop_points->x + j)]]++;
                                                                                                         ~~~~~~~~~~~^
/opt/homebrew/include/leptonica/imageio.h:241:12: note: forward declaration of 'struct Box'
    struct Box        *mediabox;     /*!< bounding region for all images      */
           ^
4 errors generated.

@Sahil-B07
Copy link

I'm also facing same issue
unable to compile manually and docker both

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants