gpt4 book ai didi

ios - 无法为 iOS 编译 LAME

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:17:32 25 4
gpt4 key购买 nike

我正在尝试将 lame mp3 编码器编译为 iOS 的静态库。我想支持所有架构,包括 i686、armv6、armv7、armv7s 和 arm64。这是我的构建脚本:

#!/bin/bash
DEVELOPER=`xcode-select -print-path`
SDK_VERSION="7.1"
mkdir build
function build_lame()
{
make distclean
./configure \
CFLAGS="-isysroot ${DEVELOPER}/Platforms/${SDK}.platform/Developer/SDKs/${SDK}${SDK_VERSION}.sdk" \
CC="${DEVELOPER}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch ${PLATFORM} -miphoneos-version-min=7.0 " \
--prefix=/Users/mcrute/Desktop/lame \
--host="arm-apple-darwin9" \
--disable-shared \
--enable-static \
--disable-decoder \
--disable-frontend

make -j4
cp "libmp3lame/.libs/libmp3lame.a" "build/libmp3lame-${PLATFORM}.a"
}
SDK="iPhoneSimulator"
PLATFORM="i686"
build_lame
SDK="iPhoneOS"
PLATFORM="armv6"
build_lame
PLATFORM="armv7"
build_lame
PLATFORM="armv7s"
build_lame
PLATFORM="arm64"
build_lame
lipo -create build/* -output build/libmp3lame.a

所以错误看起来像这样:

configure: error: in `/Users/ivan/Desktop/lame-3.99.5':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
make: *** No targets specified and no makefile found. Stop.
cp: libmp3lame/.libs/libmp3lame.a: No such file or directory

Here是我的config.log。 |试图从构建目标中删除 arm64,但脚本也因同样的错误而失败。 Google 说我没有 gcc 但我有.. 正在寻找任何建议!

最佳答案

通过在配置函数中添加 CPP="*"变量解决了这个问题。我的环境中缺少 CPP。编辑后的构建脚本应如下所示:

#!/bin/bash

DEVELOPER=`xcode-select -print-path`

SDK_VERSION="7.1"

mkdir build

function build_lame()
{
make distclean

./configure \
CPP="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cpp" \
CFLAGS="-isysroot ${DEVELOPER}/Platforms/${SDK}.platform/Developer/SDKs/${SDK}${SDK_VERSION}.sdk" \
CC="${DEVELOPER}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch ${PLATFORM} -miphoneos-version-min=7.0 " \
--prefix=/Users/ivan/Desktop/lame-3.99.5 \
--host="arm-apple-darwin9" \
--disable-shared \
--enable-static \
--disable-decoder \
--disable-frontend

make -j4
cp "libmp3lame/.libs/libmp3lame.a" "build/libmp3lame-${PLATFORM}.a"
}

PLATFORM="i686"
SDK="iPhoneSimulator"
build_lame

PLATFORM="armv6"
SDK="iPhoneOS"
build_lame

PLATFORM="armv7"
build_lame

PLATFORM="armv7s"
build_lame

PLATFORM="arm64"
build_lame

lipo -create build/* -output build/libmp3lame.a

关于ios - 无法为 iOS 编译 LAME,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25885483/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com