rdp / ffmpeg-windows-build-helpers

Helper script for cross compiling some media tools for windows, like customizable ffmpeg.exe (with or without non-free components, etc), and some other bonuses like mplayer, mp4box, mxf, etc.
GNU General Public License v3.0
1.09k stars 414 forks source link

Leptonica Failure to Build #721

Closed SmoochySix4 closed 11 months ago

SmoochySix4 commented 11 months ago

The result from the build: jp2kio.c: In function 'pixConvertToOpjImage': jp2kio.c:734:9: warning: 'bpp' is deprecated: Use prec instead [-Wdeprecated-declarations] 734 | cmptparm[i].bpp = 8; | ^~~~~~~~ In file included from jp2kio.c:117: /home/richard/build/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include/openjpeg-2.5/openjpeg.h:750:45: note: declared here 750 | OPJ_DEPRECATED_STRUCT_MEMBER(OPJ_UINT32 bpp, "Use prec instead"); | ^~~ /home/richard/build/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include/openjpeg-2.5/openjpeg.h:80:83: note: in definition of macro 'OPJ_DEPRECATED_STRUCT_MEMBER' 80 | #define OPJ_DEPRECATED_STRUCT_MEMBER(memb, msg) __attribute__ ((deprecated(msg))) memb | ^~~~ jp2kio.c: In function 'opjCreateStream': jp2kio.c:953:5: error: too few arguments to function 'opj_stream_set_user_data' 953 | opj_stream_set_user_data(l_stream, fp); | ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from jp2kio.c:117: /home/richard/build/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include/openjpeg-2.5/openjpeg.h:1235:27: note: declared here 1235 | OPJ_API void OPJ_CALLCONV opj_stream_set_user_data(opj_stream_t* p_stream, | ^~~~~~~~~~~~~~~~~~~~~~~~ make[2]: *** [Makefile:845: jp2kio.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory '/home/richard/build/ffmpeg-windows-build-helpers/sandbox/win64/leptonica_git/src' make[1]: *** [Makefile:535: all-recursive] Error 1 make[1]: Leaving directory '/home/richard/build/ffmpeg-windows-build-helpers/sandbox/win64/leptonica_git' make: *** [Makefile:419: all] Error 2

The system building the code is Hyper-V Ubuntu Server Distributor ID: Ubuntu Description: Ubuntu 22.04.3 LTS Release: 22.04 Codename: jammy

Configure options used: ./cross_compile_ffmpeg.sh --build-ffmpeg-static=y --gcc-cpu-count=8 --disable-nonfree=n --build-intel-qsv=y --sandbox-ok=y --build-libmxf=n --build-mp4box=n --build-mplayer=n --build-vlc=n --build-lsw=n --build-ismindex=n --build-svt-hevc=n --build-dvbtee=n --compiler-flavors=win64 --git-get-latest=y --build-x264-with-libav=n --prefer-stable=y --enable-gpl=y --build-dependencies=y

rdp commented 11 months ago

hmm

Lazinezz commented 11 months ago

Yeah i have the same exact issue too. linuxlite user here.

tjayz commented 11 months ago

Same exact issue. Script also fails to build libffi. Temporary fix, comment out lines 902, and 940-955, --disable-libtesseract on line 2378. Surprisingly glib build completes without libffi...

Edit: Failed to mention running WSL2 Ubuntu.

tjayz commented 11 months ago

After further testing I have determined downgrading openjpeg-2.5.0 with v2.4.0 and leptonica 1.84 to 1.82 allows tesseract build to complete.

libffi, change 'mv' on line 2852 of configure to 'cp' this seems to be wsl specific. https://github.com/libffi/libffi/issues/552

Lazinezz commented 11 months ago

After further testing I have determined downgrading openjpeg-2.5.0 with v2.4.0 and leptonica 1.84 to 1.82 allows tesseract build to complete.

libffi, change 'mv' on line 2852 of configure to 'cp' this seems to be wsl specific. libffi/libffi#552

Downgrading both openjpeg and leptonica settled that for me. I don't need to change 'mv'.

Thanks much tjayz.

rdp commented 11 months ago

OK with openjpeg 2.5.0 leptonica git built for me, probably will break eventually? :) Let me know if breaks, other ideas etc... :)

tjayz commented 11 months ago

OK with openjpeg 2.5.0 leptonica git built for me, probably will break eventually? :) Let me know if breaks, other ideas etc... :)

While this is true, it results in failed tesseract build.

880 do_git_checkout https://github.com/DanBloomberg/leptonica.git leptonica_git 1.82.0 943 do_git_checkout https://github.com/tesseract-ocr/tesseract.git tesseract_git 4.1.3 965 do_git_checkout https://github.com/uclouvain/openjpeg.git openjpeg_git v2.4.0

These versions cannot be exceeded without intervention.

rdp commented 10 months ago

git master seems to build OK here? Or are you proposing to set versions for everything, like just in case? :)

tjayz commented 10 months ago

I couldn't build without locking in lines 965 and 880 and it seems Lazinezz couldn't either, might be a wsl thing not sure. If others have the same issue they at least have a solution if they do a little searching.