Building ffmpeg 3.3 with MSYS2 + MSVC 2017 failed with so many winsock2 related redefinitions

Questions that occur when trying to compile FFmpeg.
Post Reply
JCYang
Posts: 1
Joined: Wed May 03, 2017 1:31 am

Building ffmpeg 3.3 with MSYS2 + MSVC 2017 failed with so many winsock2 related redefinitions

Post by JCYang » Wed May 03, 2017 2:01 am

MSYS2 + Visual Studio 2017 Community here, the exact steps I take to build are:
1. Start a Visual Studio 2017 "Developer Command Prompt", which effectively run vcvars.bat
2. cd into msys64 directory, and then invoke MSYS2 within the command prompt with "msys2_shell.cmd -msys2 -use-full-path", which make msys2 inherited the envs set by vcvars
3. In MSYS2 shell, cd into /somewhere/ffmpeg-build/
4. rm -rf *
5. run "../ffmpeg-3.3/configure --prefix=/somewhre/to/install/ffmpeg-bin --toolchain=msvc" in the build folder. configure script complete successfully.
6. make -j8

and then during the build, after about half done, so many winsocks2 functions related redefinition fail the build.
And I've found an easy fix, that is "../ffmpeg-3.3/configure --prefix=/somewhre/to/install/ffmpeg-bin --toolchain=msvc --extra-cflags=-DWIN32_LEAN_AND_MEAN".
Yes, the build is success, but the question bothering me is whether it is something wrong on my side or something wrong in the ffmpeg configure script? or maybe even it is the fault of VS 2017?

dbyoung
Posts: 8
Joined: Sat Apr 15, 2017 10:38 am

Re: Building ffmpeg 3.3 with MSYS2 + MSVC 2017 failed with so many winsock2 related redefinitions

Post by dbyoung » Wed Aug 23, 2017 12:32 am

winsock2.h rename winsock2.bak.h

Post Reply
'