MinGW v5.1.4 with updated bash, make, and binutils
I am trying to build Sox on Window using MingGW with Lame and FFmpeg (including Speex) support.
After successfully building static versions of Lame, Speex and FFmpeg, I am able to configure Sox like so:
./configure --with-ffmpeg --with-lame --disable-shared --enable-static
The build works right up to the link step:
../libtool --silent --tag=CC --silent --mode=link gcc -Wconversion -g -O2 -D_FORTIFY_SOURCE=2 -Wall -W -Wmissing-prototypes -Wstrict-prototypes -pedantic -o sox.exe sox.o libsox.la ../libgsm/libgsm.la ../lpc10/liblpc10.la -lavformat -lavcodec -lavutil -lmp3lame
but it fails on a ton of "undefined reference" errors in libavformat.a and libavcodec.a (see attached file).
I've found that these undefined symbols are defined in libws2_32.a and libspeex.a and can be fixed by using -lws2_32 and -lspeex.
libws2_32.a is an artifact of compiling with MinGW, while libspeex.a is there because I compiled Speex support into FFmpeg. When building on Ubuntu, the configure script seems to detect that FFmpeg is using Speex and will put in the -lspeex automatically.
Log in to post a comment.