Question

I have previously installed lame for iOS using this as a guide.

I am trying now to do something similar with TwoLame.

Unfortunately I am not successful.

mkdir build

function build_lame()
{
    make distclean

    ./configure \
        CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/${SDK}.platform/Developer/SDKs/${SDK}${SDK_VERSION}.sdk" \
        CC="/Applications/Xcode.app/Contents/Developer/Platforms/${SDK}.platform/Developer/usr/bin/gcc -arch ${PLATFORM}" \
        --prefix=/Users/jonathan/Desktop/twolame \
        --host="arm-apple-darwin9" \
        --disable-shared \
        --enable-static \

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

PLATFORM="i686"
SDK="iPhoneSimulator"
build_lame

PLATFORM="armv7"
SDK="iPhoneOS"
build_lame

PLATFORM="armv7s"
build_lame

lipo -create build

The current error I am seeing is:

 configure: error: C compiler cannot create executables
Was it helpful?

Solution

Try this. It fixes the C compiler problem you had and also some others about different paths for the SDK and GCC as well as allowing you to build all three platforms now.

mkdir -p build
rm -rf build/* #*/

function build_lame()
{
    make distclean

    ./configure \
        CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/${SDK}.platform/Developer/SDKs/${SDK}${SDK_VERSION}.sdk" \
        CC="/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch ${PLATFORM} -miphoneos-version-min=7.0" \
        --prefix="/Users/$USER/Desktop/twolame" \
        --host="arm-apple-darwin9" \
        --disable-shared \
        --enable-static \

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

SDK_VERSION=7.0

PLATFORM="i386"
SDK="iPhoneSimulator"
build_lame

PLATFORM="armv7"
SDK="iPhoneOS"
build_lame

PLATFORM="armv7s"
SDK="iPhoneOS"
build_lame

lipo -create build
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top