为iPhone构建FFTW 3.3.3

时间:2012-11-28 18:29:58

标签: ios xcode fftw

我想为iPhone构建FFTW库并使用此脚本:

#!/bin/bash

export SDKVER="6.0"
export DEVROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer"
export SDKROOT="$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk"

export CFLAGS="$CPPFLAGS -isysroot $SDKROOT"
export LDFLAGS="$CFLAGS -Wl,-syslibroot $SDKROOT"

export CC=$DEVROOT/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
export LD=$DEVROOT/usr/bin/ld

export PREFIX="$HOME/Desktop/mylib"

./configure --prefix="$PREFIX" --enable-single --host=arm-apple-darwin
make
make install

然后我在我的项目中导入Xcode中的libfftw3f.a和fftw3.h,在Build Phases中链接这个库。

当我尝试编译时,Xcode给了我这个警告:

ld: warning: ignoring file /Users/Adem/Desktop/mylib/lib/libfftw3f.a, file was built for archive which is not the architecture being linked (armv7s): /Users/Adem/Desktop/mylib/lib/libfftw3f.a

我做错了什么?

1 个答案:

答案 0 :(得分:0)

尝试将-arch armv7添加到您的CFLAGS(因此也添加到您的LDFLAGS)