microsoft / FFmpegInterop

This is a code sample to make it easier to use FFmpeg in Windows applications.
Apache License 2.0
1.31k stars 314 forks source link

failed to build FFmpeg for winRT in win10 x64 with VS2015 installed #64

Open konankid opened 8 years ago

konankid commented 8 years ago

Hello expert, I am trying to use FFmpegInterop for win10 UWP application. So I following the guidance "build FFmpeg for WinRT" https://trac.ffmpeg.org/wiki/CompilationGuide/WinRT trying to compiler for Windows 10 x64: here is some environment information: VS2015 Enterprise with 10.0.240.0 SDK OS: Windows 10 Enterprise x64 PATH were set to:Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/x86_ARM

so when I check: $ which cl /c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/x86_ARM/cl

$ which link /c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/x86_ARM/link

But when I perform "BuildFFmpeg.bat win10" I got one error: "cl is unable to create an executable file. C compiler test failed."

Am I configure anything wrong? Is anybody have the same environment with me and get green build? Or alliteratively, where can I get binary for that?

khouzam commented 8 years ago

Hi, can you look at the configure log to see what failed, and perhaps attach it?

konankid commented 8 years ago

Hi khouzam,

Last lines of my config.log file:

WARNING: pkg-config not found, library detection may fail. mktemp -u XXXXXX nV13AC check_ld cc check_cc BEGIN ./ffconf.IeVPbA8A.c 1 int main(void){ return 0; } END ./ffconf.IeVPbA8A.c cl -nologo -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00 -c -Fo./ffconf.PMS0DaMt.o ./ffconf.IeVPbA8A.c ffconf.IeVPbA8A.c /z/FFmpegInterop-master/ffmpeg/compat/windows/mslink -APPCONTAINER WindowsApp.lib -nologo -out:./ffconf.0ZsG94EB.exe ./ffconf.PMS0DaMt.o LINK : fatal error LNK1181: cannot open input file 'WindowsApp.lib' C compiler test failed.

To get this I've run below command:

SET LIB=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\store\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\lib\amd64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\um\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\lib\um\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\Lib\um\x64; SET LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64; SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\winrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\Include\um;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_arm; SET MSYS2_BIN="C:\msys64\usr\bin\bash.exe" Z:\FFmpegInterop-master\BuildFFmpeg.bat win10

And I can find WindowsApp.lib under my 10240 SDK ...\10.0.10240.0\um\x64 Besides, I 've also tried set my lib and path into 10580 SDK(I have them both), I've got the same error

Any idea would be wrong?

timotiusmargo commented 8 years ago

Hi konankid,

The BuildFFmpeg.bat already set the environment variables you set above. Could you try just running running it in a new command prompt without setting those manually? I.e.

BuildFFmpeg.bat win10 x64

If you'd rather do the build manually by setting your environment variables etc, use the configure and make tools in MSYS2 shell as described in the FFmpeg wiki below: https://trac.ffmpeg.org/wiki/CompilationGuide/WinRT#Windows10x64

Let us know how it goes.

konankid commented 8 years ago

Hi timotiusmargo, I've tried that before I build it manually. If I run

BuildFFmpeg.bat win10 x64

Firstly I have error

MSYS2 is needed. Set it up properly and provide the executable path in MSYS2_BIN environment variable. E.g. set MSYS2_BIN="C:msys64\usr\bin\bash.exe"

Then I set the path in cmd, and then run the first cmd again, got below error:

cl is unable to create an executable file

If I open the config.log, same error below:

LINK: fatal error LNK1181: cannot open input file 'WindowsApp.lib'

khouzam commented 8 years ago

Hi @konankid

Can you try again with the latest code? We had an older version of MSYS and some recent updates have changed how the environment is passed from Windows to MSYS. We think we've addressed the issue in the latest buildFFmpeg script.

Thanks.