构建x264,错误:找不到signal.h

时间:2017-12-13 14:48:00

标签: x264

使用构建脚本构建x264时:

#!/bin/bash
NDK=/Local/Android/sdk/android-ndk-r16b

PLATFORM=$NDK/platforms/android-26/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
PREFIX=./android/arm

function build_one
{
 ./configure \
 --prefix=$PREFIX \
 --enable-static \
--enable-pic \
 --host=arm-linux \
 --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
 --sysroot=$PLATFORM

  make clean
  make
  make install
}

build_one

echo Android ARM builds finished

但我总是遇到错误:

x264.c:40:20: fatal error: signal.h: No such file or directory
#include <signal.h>
                ^

编译终止。 :目标'x264.o'的配方失败 make:*** [x264.o]错误1

1 个答案:

答案 0 :(得分:0)

android-ndk-r16b的一个变化是The deprecated headers have been removed. Unified Headers are now simply "The Headers". For migration tips, see Unified Headers Migration Notes.

所以在android-ndk-r16b中不再存在signal.h。您可以使用较低版本的NDK,例如android-ndk-r15c。