I'm trying to compile and install the x264 H.264/AVC encoder. I've got gcc
installed. But I get the 'No working C compiler found' error when I run:
我正在尝试编译和安装x264 H.264/AVC编码器。我有安装gcc。但是当我运行时,我得到了'没有工作的C编译器发现'错误:
./configure --enable-shared --enable-static
What can I do?
我能做什么?
The config log said:
配置日志说:
/bin/gcc conftest.c -Wall -I. -I$(SRCPATH) -falign-loops=16 -mdynamic-no-pic -o conftest
clang: error: unknown argument: '-falign-loops=16' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
2 个解决方案
#1
3
I encountered the same error and found a simple solution here: http://www.xin.at/x264/x264-guide-macosx-en.htm
我遇到了同样的错误,找到了一个简单的解决方案:http://www.xin.at/x264/x264-guide-macosx-en.htm。
Before actually being able to start the build we will however need to remove a GCC compiler flag from the configure script, that the newer LLVM+CLANG compiler will not be able to handle. For that, please open the file configure in your favorite text editor and look for the following spot:
在实际开始构建之前,我们需要从configure脚本中删除GCC编译器标志,新的LLVM+CLANG编译器将无法处理。为此,请在您喜爱的文本编辑器中打开文件配置,并查找以下位置:
darwin*) SYS="MACOSX" CFLAGS="$CFLAGS -falign-loops=16"
达尔文*)SYS = " MACOSX " CFLAGS = " $ CFLAGS -falign-loops = 16 "
Replace that with the following, effectively removing the -falign-loops=16 option:
用下面的方法替换它,有效地删除- faligni -loop =16选项:
darwin*) SYS="MACOSX" CFLAGS="$CFLAGS"
达尔文*)SYS = " MACOSX " CFLAGS = " $ CFLAGS "
After doing the above, libx264 builds just fine :)
在完成上述操作之后,libx264构建得很好:)
#2
0
The configure
script is trying to set a compiler option -falign-loops=16
that the clang
compiler (masquerading as gcc
) declines to accept.
configure脚本试图设置一个编译器选项-falign-loop =16, clang编译器(伪装成gcc)拒绝接受。
Either get (compile) your own real GCC and use that (I've done the compilation and installation; it's not very hard, though neither is it trivial), or work out how to stop the configure
script from failing simply because it assumes that the -falign-loops=16
option must be supported by all versions of GCC. That is the sort of thing the configure
script should be checking so that you don't run into that sort of failure. Ultimately, this is a bug in the configuration for this code.
要么得到(编译)您自己的真正GCC,然后使用它(我已经完成了编译和安装;虽然这不是很困难,但也不是很简单,或者解决了如何停止配置脚本的失败,因为它假定- faligni -loop =16选项必须由GCC的所有版本支持。这就是configure脚本应该检查的东西,这样您就不会遇到那种失败。最终,这是该代码配置中的一个错误。
#1
3
I encountered the same error and found a simple solution here: http://www.xin.at/x264/x264-guide-macosx-en.htm
我遇到了同样的错误,找到了一个简单的解决方案:http://www.xin.at/x264/x264-guide-macosx-en.htm。
Before actually being able to start the build we will however need to remove a GCC compiler flag from the configure script, that the newer LLVM+CLANG compiler will not be able to handle. For that, please open the file configure in your favorite text editor and look for the following spot:
在实际开始构建之前,我们需要从configure脚本中删除GCC编译器标志,新的LLVM+CLANG编译器将无法处理。为此,请在您喜爱的文本编辑器中打开文件配置,并查找以下位置:
darwin*) SYS="MACOSX" CFLAGS="$CFLAGS -falign-loops=16"
达尔文*)SYS = " MACOSX " CFLAGS = " $ CFLAGS -falign-loops = 16 "
Replace that with the following, effectively removing the -falign-loops=16 option:
用下面的方法替换它,有效地删除- faligni -loop =16选项:
darwin*) SYS="MACOSX" CFLAGS="$CFLAGS"
达尔文*)SYS = " MACOSX " CFLAGS = " $ CFLAGS "
After doing the above, libx264 builds just fine :)
在完成上述操作之后,libx264构建得很好:)
#2
0
The configure
script is trying to set a compiler option -falign-loops=16
that the clang
compiler (masquerading as gcc
) declines to accept.
configure脚本试图设置一个编译器选项-falign-loop =16, clang编译器(伪装成gcc)拒绝接受。
Either get (compile) your own real GCC and use that (I've done the compilation and installation; it's not very hard, though neither is it trivial), or work out how to stop the configure
script from failing simply because it assumes that the -falign-loops=16
option must be supported by all versions of GCC. That is the sort of thing the configure
script should be checking so that you don't run into that sort of failure. Ultimately, this is a bug in the configuration for this code.
要么得到(编译)您自己的真正GCC,然后使用它(我已经完成了编译和安装;虽然这不是很困难,但也不是很简单,或者解决了如何停止配置脚本的失败,因为它假定- faligni -loop =16选项必须由GCC的所有版本支持。这就是configure脚本应该检查的东西,这样您就不会遇到那种失败。最终,这是该代码配置中的一个错误。