ffmpeg6.01代码在windows编译,按下面步骤
1.安装了MSYS2及vs2022社区版,
2.参照网上说的打开MSYS2 MINGW64,执行了pacman -S mingw-w64-x86_64-toolchain和pacman -S base-devel,
3.接着进入ffmpeg源代码目录,执行 ./configure --prefix=./install --toolchain=msvc --arch=x86 --enable-shared --enable-gpl --enable-libx264 --enable-libx265 --enable-dxva2 --enable-cross-compile
提示错误如下:
Admin@DESKTOP-BR9VGL7 MINGW64 /d/bj/ffmpeg6
$ ./configure --prefix=./install --toolchain=msvc --arch=x86 --enable-shared --enable-gpl --enable-libx264 --enable-libx265 --enable-dxva2 --enable-cross-compile
cl.exe is unable to create an executable file.
C compiler test failed.
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@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.
config.log中错误如下,
zRQbBq
WARNING: Unknown C compiler cl.exe, unable to select optimal CFLAGS
test_ld cc
test_cc
BEGIN ./ffconf.br6QZA64/test.c
1 int main(void){ return 0; }
END ./ffconf.br6QZA64/test.c
cl.exe -c -o ./ffconf.br6QZA64/test.o ./ffconf.br6QZA64/test.c
./configure: line 995: cl.exe: command not found
C compiler test failed.
在环境变量path中添加cl.exe的路径"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64",还是报一样的错误,请问是什么原因,vs2022也重新安装过重启过电脑了