c++ffmpegcross-compilingstatic-librariesmingw-w64

Can MinGW's static library be linked to MSVC


I use mingw-w64 on linux to cross compile the ffmpeg static library for windows with the following command:

./configure --arch=x86 --disable-doc --disable-ffplay --disable-ffprobe --disable-ffmpeg --prefix=/mnt/c/ffmpeg --enable-gpl --enable-nonfree --target-os=mingw32 --cross-prefix=i686-w64-mingw32- --pkg-config=pkg-config --disable-shared --enable-static

make -j16
make install

Then I got some .a files instead of .lib files. Can I directly link these files to MSVC? If not, what should I do next?


Solution

  • Even though you asked for a cross-compilation, here's how you do it natively on Windows. I'd rather do this than trying to use MinGW libraries with MSVC.

    This is adapted to MSYS2 from the official guide that uses MSYS1.