1.下载msys2工具
2.启动msys2工具
开发控制台进入到msys2安装目录,执行如下命令:
msys2_shell.cmd -mingw64
3.安装mingw64组件
pacman -sS mingw64 //搜索一下可以用ming64版本
pacman -S make yasm diffutils pkg-config
pacman -S mingw-w64-i686-gcc
pacman -S mingw-w64-x86_64-gcc //找一个包装上即可
pacman -S perl //安装perl
4.下载openssl
wget https://www.openssl.org/source/openssl-1.0.2t.tar.gz
tar -zxvf openssl-1.0.2t.tar.gz
5.编译
./config //生成makefile
make -j20 //编译
6.生成lib
dumpbin /exports libssl-1_1-x64.dll > libssl.def
lib /def:libssl.def /machine:x64 /out:libssl.lib
msys2真好用,编译nginx,ffmpeg,libx264,vlc都可以,推荐给大家