Open coral opened 8 years ago
Can you look at the configure log to see what might be failing?
Hi @coral
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.
Hi there! I guess I'm facing the same problem. I just downloaded the latest code. Here are the last couple of lines from my config.log:
. . zoompan_filter=yes zoompan_filter_deps=swscale WARNING: pkg-config not found, library detection may fail. mktemp -u XXXXXX z83Vms check_ld cc check_cc BEGIN ./ffconf.qtofmUve.c 1 int main(void){ return 0; } END ./ffconf.qtofmUve.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.BK8mpYDh.o ./ffconf.qtofmUve.c ffconf.qtofmUve.c link -APPCONTAINER WindowsApp.lib -o ./ffconf.9uGzz4YC.exe ./ffconf.BK8mpYDh.o link: unknown option -- A Try 'link --help' for more information. C compiler test failed.
any ideas?
I installed pkg-config with pacman -S pkg-config
, but still I'm unable to build.
config.log
zoompan_filter_deps=swscale
mktemp -u XXXXXX
PSKP72
check_ld cc
check_cc
BEGIN ./ffconf.8gJjbbTD.c
1 int main(void){ return 0; }
END ./ffconf.8gJjbbTD.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.RhmeOMsT.o ./ffconf.8gJjbbTD.c
ffconf.8gJjbbTD.c
link -APPCONTAINER WindowsApp.lib -o ./ffconf.1PVtJIuY.exe ./ffconf.RhmeOMsT.o
link: unknown option -- A
Try 'link --help' for more information.
C compiler test failed.
$ which cl
/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/amd64_x86/cl
$ which link
/usr/bin/link
$ which armasm
/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_arm/armasm
$ which yasm
/usr/bin/yasm
$ which cpp
/usr/bin/cpp
in BuildFFmpeg.bat I also set the MSYS2_PATH_TYPE=inherit
@setlocal
@echo off
if "%1" == "/?" goto Usage
if "%~1" == "" goto Usage
:: Initialize build configuration
set BUILD.ARM=N
set BUILD.x86=N
set BUILD.x64=N
set BUILD.win10=N
set BUILD.win8.1=N
set BUILD.phone8.1=N
set MSYS2_PATH_TYPE=inherit
Visual Studio Community 2015, Win 10
It looks like I could build successfully. I switched from branch master to origin/ffmpeg3.0.1 (d81eacbdca7c19a03ff5626bf26fdb7cf20f77a4)
Hi @arn0dre
It looks like link in your path is the one from MSYS and not from Visual Studio.
From the instructions on https://trac.ffmpeg.org/wiki/CompilationGuide/WinRT
You might have missed this following step:
Rename or remove link.exe in the MSYS2 usr bin folder (E.g. C:\msys64\usr\bin\link.exe) to prevent conflict with MSVC link.exe
$ 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
$ which armasm /c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_arm/armasm
$ which yasm /usr/bin/yasm
$ which cpp /usr/bin/cpp
...but I meet the same problem"cl is unable to create an executable file.C compiler test failed.“
And these are the last several lines of the file "config.log":
WARNING: Unknown C compiler cl, unable to select optimal CFLAGS check_ld cc check_cc BEGIN ./ffconf.8v8wIhCG.c 1 int main(void){ return 0; } END ./ffconf.8v8wIhCG.c cl -MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00 -D__ARM_PCS_VFP -march=armv7 -c -o ./ffconf.XHNTZqQU.o ./ffconf.8v8wIhCG.c ../../../configure: line 872: cl: command not found C compiler test failed.
Hi @DaweiX,
Can you open FFmpegConfig.sh and copy the command-line to build FFmpeg and see if that works? If cl is not found that's usually a sign that the path is not properly passed to MSys2.
From https://trac.ffmpeg.org/wiki/CompilationGuide/MSVC Note: You might see an error saying cl can't generate executable; this is because you installed the link.exe from MSYS. It conflicts with the link.exe of Visual Studio. This can also indicate that you are mixing 64bit and 32bit versions of cl.exe and link.exe. So what should I do with a x64 machine? I tried "export PATH="/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/amd64_arm/":$PATH" instead of “export PATH=$PATH:"/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_arm"” and then used "which" to see if cl and link can be found. But msys2 still says " cl is unable to create an executable file."
I'm also hitting the "cl is unable to create...." error. In WSL bash, which cl
returns nothing, but then I wouldn't expect it to since I've done nothing to add it to the path and I'd expect it to be a win32 exe that wouldn't run in WSL. What have I missed and/or assumed incorrectly? Thanks in advance.
Also, it doesn't appear that pushd and popd are supported in my WSL bash environment. Is that something I'm missing, or something enabled via the scripts running and so wouldn't appear available in a terminal?
@DaweiX,
There are a many reasons why this fails and a lot of hints are in the log. "cl is unable to create an executable" is usually the message but looking at config.log helps identify the root cause.
In your scenario. it looks like this is the cause: ../../../configure: line 872: cl: command not found So that usually means that cl is not in the path.
Can you detail the steps that you're taking to build. Are you setting up your environment and then calling configure? What parameters are you passing to configure? Can you attach your complete config.log as it has some valuable information (such as the PATH used within the script).
@rainabba.
For the WSL interop, unlike with MSys, the full filename needs to be included, so if you want to check if cl is in your path, you need to do which cl.exe
with the extension.
pushd and popd should be fully supported in WSL. What build of Windows are you running?
Hello I am having a similiar problem,
I've uploaded my log to: http://www.filedropper.com/config_131
@khouzam Thank you. I suspect my issue is as mentioned at https://github.com/Microsoft/FFmpegInterop/issues/102 .I realized that I'm on 14393. Thinking about taking the dive on my main workstation to use an insider build. In the meantime, I'm going to revisit all of this on another machine with a newer build and see if I can get past it there. In that other issue, someone also mentioned updating Ubuntu (I assume they mean the WSL environment) to 16.x so I'll keep an eye on that also.
Hi @lukiyori
It looks like your install of Visual Studio seems to be slightly broken. Can you build a simple C++ project from Visual Studio? Can you try to repair your Visual Studio install?
Hi @khouzam ,
The problem was not related with the Visual Studio, I build by following the steps from scratch finally I could be able to build by using the BuildFFmpeg.bat. Thank you very much.
@lukiyori,
Great, glad to hear its working.
in Developer Command Prompt try this msys2_shell.cmd -use-full-path
I ran into this problem recently and found this issue at the top of Google, so I figured I'd drop this here for any future pioneers building FFMPEG in this manner, following this guide
https://trac.ffmpeg.org/wiki/CompilationGuide/WinRT
The problem with that guide is when it tells you to set some environment variables in the command prompt before launching the MSYS2 shell, to build the actual code (ffmpeg). Specifically This. Friggin. Step.
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;
First of all, those paths may not even resolve to anything so double check. in my case %VSINSTALLDIR% wasn't even defined. These paths also vary depending on which version of VS you have, and which version of the build tools. For example:
%VSINSTALLDIR%VC\lib\store\amd64
was flat out wrong. I had to change it to
%VSINSTALLDIR%VC\Tools\MSVC\14.22.27905\lib\x64\store
to actually point it to the right place
Anyways, root cause is likely this: it can't compile because it can't find the dang libs or headers, cause the Include And Lib paths are likely borked, so double check those paths before building anything. Daggum
Was this issue really not solved? Same problem:
WARNING: Unknown C compiler cl.exe, unable to select optimal CFLAGS test_ld cc test_cc BEGIN ./ffconf.kDMpVa6Q/test.c 1 int main(void){ return 0; } END ./ffconf.kDMpVa6Q/test.c cl.exe -DCONFIG_SAFE_BITSTREAM_READER=1 -c -o ./ffconf.kDMpVa6Q/test.o ./ffconf.kDMpVa6Q/test.c ./configure: line 974: cl.exe: command not found C compiler test failed.
in Developer Command Prompt try this
msys2_shell.cmd -use-full-path
I'm getting the same problems in a different project while building libav on Windows, but running this command from msys2 root folder solved the cl
problem for me!
I am trying to install nv-codec-headers, I follow the steps shown here: Steps I follow
Steps:
Open Shell Vision Studio 2019 -> Developer Command Prompt for VS 2019
C:/msys64/mingw64.exe
export PATH="/C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/HostX64/x64/":$PATH
export PATH="/C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/bin/":$PATH
cd C:/nv-codec-headers
make install PREFIX=/usr
cd C:/ffmpeg
-> ./configure --enable-nonfree --disable-shared --enable-cuda-nvcc --enable-libnpp –-toolchain=msvc --extra-cflags=-I../nv_sdk --extra-ldflags=-libpath:../nv_sdk
Then when I get here, I get this error: "cl.exe is unable to create an executable file. If cl.exe is a cross-compiler, use the --enable-cross-compile option. Only do this if you know what cross compiling means. C compiler test failed.
If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat. Include the log file "ffbuild/config.log" produced by configure as this will help solve the problem."
I have attached the completed config log Config Log
Please help me. I really want to fix this issue. Thank you for your help.
I had the same problem while trying to build ffmpeg for msvc x64 instead of x86 so I chnaged cl and link to x64 but still had a problem then I checked config.log in ffbuild folder I noticed it's linking against x86 libs so I changed environment variables "LIB" and "LIBPATH" to x64 libs and that fixed the problem for me. PS: I'm posting for anyone facing the same issue.
Set operating system environment variables
MSYS2_PATH_TYPE=inherit
I solved it successfully
Followed the guide
Configure throws:
cl is unable to create an executable file. C compiler test failed.