Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails on Windows 10 x64 #48

Open
MantasMiksys opened this issue Dec 3, 2015 · 18 comments
Open

Compilation fails on Windows 10 x64 #48

MantasMiksys opened this issue Dec 3, 2015 · 18 comments

Comments

@MantasMiksys
Copy link

HI there,

I was following the instructions provided in https://trac.ffmpeg.org/wiki/CompilationGuide/WinRT for
Windows 10 x64. I intstalled all of the required dependencies (e.g. yasm) and checked their location.

When I run

../../../configure \
--toolchain=msvc \
--disable-programs \
--disable-d3d11va \
--disable-dxva2 \
--arch=x86_64 \
--enable-shared \
--enable-cross-compile \
--target-os=win32 \
--extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00" \
--extra-ldflags="-APPCONTAINER WindowsApp.lib" \
--prefix=../../../Build/Windows10/x64

I get the following error:

cl is unable to create an executable file.
C compiler test failed.

These are the last lines of config.log file:

zoompan_filter_deps=swscale
WARNING: pkg-config not found, library detection may fail.
mktemp -u XXXXXX
cx2bM3
check_ld cc
check_cc
BEGIN ./ffconf.toPsa9fQ.c
    1   int main(void){ return 0; }
END ./ffconf.toPsa9fQ.c
cl -nologo -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64 -MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00 -c -Fo./ffconf.9ghOJ6lK.o ./ffconf.toPsa9fQ.c
ffconf.toPsa9fQ.c
link -APPCONTAINER WindowsApp.lib -nologo -out:./ffconf.66UshOWN.exe ./ffconf.9ghOJ6lK.o
LINK : fatal error LNK1181: cannot open input file 'WindowsApp.lib'
C compiler test failed.

Any ideas what could be wrong?

@timotiusmargo
Copy link
Contributor

Could you please share your Visual Studio 2015 and Windows SDK version?

@MantasMiksys
Copy link
Author

I am using MS Visual Studio 2015 Community version 14.023107.0 and I have Windows SDK v7.0A, v8.0, v8.1, v8.1, v10.0A in my C:\Program Files (x86)\Microsoft SDKs\Windows directory.

@timotiusmargo
Copy link
Contributor

Could you please check if you have the following folder from Visual Studio 2015 installation?
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10586.0\um\x64\WindowsApp.lib

I just downloaded the latest official Visual Studio 2015 Update 1 that was released less than a week ago on a fresh machine. With this new setup and following the instruction on https://trac.ffmpeg.org/wiki/CompilationGuide/WinRT I can build Windows 10 FFmpeg libraries for any target including x64 without any problem.

Could you also simply try running FFmpegInterop\BuildFFmpeg.bat from the command prompt? E.g. BuildFFmpeg.bat win10 x64

@MantasMiksys
Copy link
Author

Sorry about the delay. The folder (10.0.10586.0) was missing, I had (10.0.10240.0). When I updated Visual Studio 2015 to the latest version, the problem remained. I was still getting the same error when following the instructions.

When I ran BuildFFmpeg.bat win10 x64 from the command prompt I got an error saying that MSYS2_BIN environment variable is missing. Running set MSYS_BIN="C:\msys64\usr\bin\bash.exe" fixed that and then running BuildFFmpeg.bat win10 x64 installed the library. I have bin, include and lib folders in ffmpeg\Build\Windows10\x64 as expected.

However, I cannot run any of the sample solutions because The name 'FFmpegInteropMSS' does not exist in the current context. That is probably because FFmpegInterop\Debug\FFmpegInterop.Windows folder is empty while the sample solution is trying to use FFmpegInterop.winmd file from it. Does it mean that library setup failed?

@dargmuesli
Copy link

To get this (C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10586.0\um\x64\WindowsApp.lib) file use the Windows Control Panel, go to Programs and Features and double click Microsoft Visual Studio Community 2015. Then select Customize (or "Adjust", I see "Anpassen" as I'm from Germany) and select Tools (1.2) and Windows 10 SDK (10.0.10586) under Development Tools for Universal Windows Apps under Windows and Web Development (again: translations may differ). Then hit UPDATE. If that doesn't work try Emulators for Windows 10 Mobile (10.0.10586) and/or Windows 10 SDK (10.0.10240) too

@MantasMiksys
Copy link
Author

That worked. Thanks.

@timotiusmargo
Copy link
Contributor

Thank you @dargmuesli! 👍

@jmc5113
Copy link
Member

jmc5113 commented Dec 4, 2016

I'm also having this error. My config.log shows the same as MantasMiksys at the bottom.
VS Version: 14.0.25431.01 Update 3
Kit Version: 10.0.14393.0

I have confirmed that the WindowsApp.lib is present:
"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x64\WindowsApp.lib"

WARNING: pkg-config not found, library detection may fail.
mktemp -u XXXXXX
j8NHH5
check_ld cc
check_cc
BEGIN ./ffconf.5fuIrd1z.c
1 int main(void){ return 0; }
END ./ffconf.5fuIrd1z.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.GMAEQJre.o ./ffconf.5fuIrd1z.c
ffconf.5fuIrd1z.c
/c/Users/jmc51/Downloads/FFmpegInterop-master/FFmpegInterop-master/ffmpeg/compat/windows/mslink -APPCONTAINER WindodwsApp.lib -nologo -out:./ffconf.HGWtQiKp.exe ./ffconf.GMAEQJre.o
LINK : fatal error LNK1181: cannot open input file 'WindodwsApp.lib'
C compiler test failed.

@khouzam
Copy link
Contributor

khouzam commented Dec 5, 2016

Hi @jmc5113,

From the logs, it looks like there's a typo in the lib name. Can you check if there's any change in the FFmpegConfig.sh script? There seems to be an extra d when setting the library name for WindowsApp.lib.

@jmc5113
Copy link
Member

jmc5113 commented Dec 5, 2016

Yes, Thank You for catching that! I made the typo when typing out the ../../../configure... command. Thanks again, it appears to be working now :-)

@chenwdong
Copy link

mktemp -u XXXXXX
uPUEIt
test_ld cc
test_cc
BEGIN ./ffconf.dLV1HRMu/test.c
1 int main(void){ return 0; }
END ./ffconf.dLV1HRMu/test.c
cl -nologo -MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00 -c -Fo./ffconf.dLV1HRMu/test.o ./ffconf.dLV1HRMu/test.c
test.c
/c/workspace/FFmpegInterop/ffmpeg/compat/windows/mslink -APPCONTAINER WindowsApp.lib -nologo -out:./ffconf.dLV1HRMu/test.exe ./ffconf.dLV1HRMu/test.o
LINK : fatal error LNK1181: cannot open input file WindowsApp.lib
C compiler test failed.
image

why??? @khouzam

@chenwdong
Copy link

@khouzam ../../../configure
--toolchain=msvc
--disable-programs
--disable-d3d11va
--disable-dxva2
--arch=x86_64
--enable-shared
--enable-cross-compile
--target-os=win32
--extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00"
--extra-ldflags="-APPCONTAINER WindowsApp.lib"
--prefix=../../../Build/Windows10/x64

@chenwdong
Copy link

@khouzam help!!

@khouzam
Copy link
Contributor

khouzam commented Apr 3, 2018

Hi @chenwdong

In the future, it would be better for you to open a new issue instead of commenting on an old closed one.

Did you install the UWP C++ SDK as part of your VS install?

@khouzam khouzam reopened this Apr 3, 2018
@chenwdong
Copy link

@khouzam I found the same problem and I found it here,I found that I didn't install UWP C++ SDK,and I am trying to install it. Keep an eye on it,thank youuuuuuuu!

@chenwdong
Copy link

@khouzam
image
I updated win10 SDK, but it's still the same mistake. What is lacking now?

@khouzam
Copy link
Contributor

khouzam commented Apr 3, 2018

@chenwdong

Are you using BuildFFmpeg.bat or manually invoking the script? It looks like the LIB path is not properly set for WindowsApp.lib

This is what we're doing in BuildFFmpeg.bat

call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x64 store
set LIB=%VSINSTALLDIR%VC\lib\store\amd64;%VSINSTALLDIR%VC\atlmfc\lib\amd64;%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64;;%UniversalCRTSdkDir%lib\%UCRTVersion%\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=%VSINSTALLDIR%VC\atlmfc\lib\amd64;%VSINSTALLDIR%VC\lib\amd64;
set INCLUDE=%VSINSTALLDIR%VC\include;%VSINSTALLDIR%VC\atlmfc\include;%UniversalCRTSdkDir%Include\%UCRTVersion%\ucrt;%UniversalCRTSdkDir%Include\%UCRTVersion%\um;%UniversalCRTSdkDir%Include\%UCRTVersion%\shared;%UniversalCRTSdkDir%Include\%UCRTVersion%\winrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\Include\um;

@dargmuesli
Copy link

@khouzam I think we can close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants