[FFmpeg-user] Can't build ffmpeg shared libraries under Windows with dash enabled (missing libxml2)

thomas l thomas.pontal at gmail.com
Fri Nov 5 20:42:09 EET 2021


I can't build ffmpeg shared libraries under Windows with the mpeg dash
demuxer enabled.

The problem is always that libxml2 is missing.

I always get the error : " ERROR: libxml-2.0 not found using pkg-config"

Here is what I have done:

I installed msys2
I run cmd from Visual Studio 2015 (Tools > Command prompt) and I run msys2
from there:

C:\msys64>C:\msys64\msys2_shell.cmd -msys

Then, in msys2, I install this:

pacman -S make
pacman -S diffutils
pacman -S yasm
pacman -S mingw-w64-x86_64-gcc
pacman -S mingw-w64-i686-gcc
pacman -S pkg-config
pacman -S mingw-w64-x64-libxml2
pacman -S mingw-w64-x86_64-libxml2
export PATH=$PATH:"C:\Program Files (x86)\Microsoft Visual Studio

I go to ffmpeg's folder and I run:

./configure --target-os=win64 --arch=x86_64 --toolchain=msvc
--enable-shared --enable-demuxer=dash --enable-libxml2

And I face this error:

ERROR: libxml-2.0 not found using pkg-config

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user at ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this
will help
solve the problem.

And yet, I have libxml-2.0.pc in C:\msys64\mingw64\lib\pkgconfig

I don't know if it can help but "pkg-config --libs libxml2" returns:

Package libxml2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml2' found

And "pkg-config --libs libxml-2.0" returns:
-L/mingw64/lib -lxml2 -lz -llzma -liconv -lws2_32

Could someone please save me with a solution?


More information about the ffmpeg-user mailing list