msys
是Windows下模拟linux运行的最新系统, 可以通过类似于linux bash的命令行窗口进行代码编译。
1、安装包地址
前往官网下载MSYS2安装包 MSYS2 (假设安装至 D:\msys64)
安装完成后,在 D:\msys64目录下会创建类似linux下的目录结构(类似挂载)
2、基本使用
1)修改msys2_shell.cmd文件 (为了使用visual studio的c编译器)
将 rem set MSYS2_PATH_TYPE=inherit
改成 set MSYS2_PATH_TYPE=inherit
2) 启动mingw64指令
打开x64 Native Tools Command Prompt for VS 2019
输入 msys2_shell.cmd -mingw64
此时,执行指令可能会报错(msys2_shell.cmd 不是内部、外部指令),由于 D:\msys64(每个人不同) 没有加入到环境变量。
添加环境变量方法: 我的电脑 右键-》属性-》高级系统设置-》环境变量-》系统变量-》path添加想加的路径。
3、使用msys2的报错记录
1)、直接打开mingw64 执行./configure 会报错:
configure: error: no acceptable C compiler found in $PATH
找不到c编译器,在本文中设置的继承visual studio的编译器,所以采用2-1)中步骤可解决这个问题。
2)、在使用2-2)步骤执行./configure指令报错:
configure: error: no acceptable ld found in $PATH
使用 pacman -S mingw-w64-x86_64-toolchain 指令添加相应编译工具。
3)、使用make指令未找到
bash: make: command not found
使用pacman -S make 安装make
4、参考
FFmpeg:编译(Windows)_满嘴跑火车的小土匪的博客-CSDN博客_ffmpeg windows编译
WINDOWS编译FFMPEG4.3 搭建VS2019开发环境 - 前端 - 工具 (liboliu.com)
windows10编译ffmpeg带ffplay_ScottAci的博客-CSDN博客_ffplay windows 编译