Log in

View Full Version : Subtext build for Windows error


vxzms
1st April 2021, 02:56
I try to compile Subtext for Windows because some font can’t render correctly, may be libass library too old.
I can’t find how to build it in Windows so cross-compile on Ubuntu 20.04. But I encounter some error what I don’t know how to solve. And I don’t know how to build Windows libsubtext correctly.
Under is my process.

sudo apt-get install git build-essential pkg-config autotools-dev autoconf libtool yasm nasm libfreetype6-dev libfontconfig1-dev libfribidi-dev libharfbuzz-dev win-iconv-mingw-w64-dev mingw-w64-x86-64-dev gcc-mingw-w64

build libass:

git clone https://github.com/libass/libass.git
./autogen.sh
./configure
make
sudo make install


build ffmpeg:

git clone https://git.ffmpeg.org/ffmpeg.git
./configure --enable-gpl --enable-version3 --enable-shared --disable-encoders --disable-programs --disable-filters --disable-doc --disable-avdevice --disable-avfilter --disable-network --disable-postproc
make -j4
sudo make install


build Subtext:

git clone https://github.com/vapoursynth/vapoursynth.git
./autogen.sh
./configure --disable-core --disable-python-module --disable-vsscript --disable-plugins --enable-subtext --host=x86_64-w64-mingw32 --disable-static
make -j4


Subtext build error:

/usr/bin/ld: unrecognized option '--enable-auto-image-base'
/usr/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
make: *** [Makefile:1176: libsubtext.la] Error 1

Subtext build full log (https://paste.ee/p/3wn0c)

feisty2
1st April 2021, 08:04
it seems that the source code is really out of date (all that deprecation warnings), it compiled nevertheless, and something unexpected caused a linking failure (probably some breaking changes in the upstream library). someone should probably rewrite this whole thing.

jackoneill
1st April 2021, 10:46
I'm pretty sure it should be calling /usr/bin/x86_64-w64-mingw32-ld instead of /usr/bin/ld. You do have it, right?

If you run "make V=1" you'll see the full command it tries to run. Worst case, you copy it all, replace ld's name, and run it manually.

And now I notice that you didn't compile libass and ffmpeg for Windows. You have to pass --host=x86_64-w64-mingw32 when you configure libass, and for ffmpeg you need

--enable-cross-compile --cross-prefix="x86_64-w64-mingw32-" --target-os=mingw32 --arch=x86_64

because ffmpeg's configure script is special.

vxzms
1st April 2021, 17:17
I'm pretty sure it should be calling /usr/bin/x86_64-w64-mingw32-ld instead of /usr/bin/ld. You do have it, right?

If you run "make V=1" you'll see the full command it tries to run. Worst case, you copy it all, replace ld's name, and run it manually.

And now I notice that you didn't compile libass and ffmpeg for Windows. You have to pass --host=x86_64-w64-mingw32 when you configure libass, and for ffmpeg you need

--enable-cross-compile --cross-prefix="x86_64-w64-mingw32-" --target-os=mingw32 --arch=x86_64

because ffmpeg's configure script is special.

thx, I will recompile ffmpeg, libass and dependencies. libass has many dependencies.