PocketSphinx,文件不是iPhone设备中所需的架构,但在模拟器中工作?

时间:2010-04-27 00:05:20

标签: iphone xcode

我是Apple开发的新手,对于我的Uni项目,我尝试使用PocketSphinx开发iPhone应用程序以识别语音命令......

我使用了PocketSphinx SVN和SphinxBase中提供的“build_for_iphoneos.sh”脚本。当我在模拟器上尝试时,程序工作没有任何问题,今天我尝试在设备上部署,它给了我这个错误?请问有谁帮我解决这个问题?

错误:

ld: warning: in /Users/me/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.2.sdk/lib/libpocketsphinx.a, file is not of required architecture
ld: warning: in /Users/me/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.2.sdk/lib/libsphinxbase.a, file is not of required architecture

并且函数的其余引用报告未定义的错误!

任何帮助?谢谢。杰文

2 个答案:

答案 0 :(得分:1)

...解决 按照Sphinx提供的说明,每个人都将按照自述文件中提到的顺序进行操作。这是:

./build_for_iphoneos.sh simulator
./build_for_iphoneos.sh device

因为Simulator是基于i386架构的,当调用“./build_for_iphoneos.sh device”时,它仍然保留了之前的缓存而忽略了armv6体系结构的变化......

要解决这个问题, 在他们之间打电话“Make Clean”......

./build_for_iphoneos.sh simulator
make clean
./build_for_iphoneos.sh device

希望这有助于其他人...... 感谢“lucius”的帮助..我已经学到了一些关于Lipo工具...... :)。

答案 1 :(得分:0)

通常,当您需要为arm构建时,只有为Intel构建静态库时才会发生此错误。如果使用lipo工具,则可以为这两种体系结构提供胖二进制文件。

编辑:哎呀,我的意思是“脂肪”工具,它被自动修正为唇。要为iPhone OS设备(arm6 / arm7)和模拟器(i386)创建胖二进制iPhone静态库,请使用以下内容:

lipo -output libOAuthConsumerTouch.a -create Release-iphoneos/libOAuthConsumerTouch.a Release-iphonesimulator/libOAuthConsumerTouchSim.a

那是一个名为“OAuthConsumerTouch”的库