4

我有一个 xcode Objective-C iPhone 静态库项目。当我在 xcode 中构建它时,我没有收到任何错误或警告。但是当我从命令行使用 xcodebuild 构建它时,我得到:

"/Developer/usr/bin/gcc" -v -dM -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk -E -arch armv6 -o - -x objective-c /dev/null
gcc-4.2: error trying to exec '/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1': execvp: No such file or directory

我找不到任何可以帮助我理解问题所在的东西,有什么想法吗?

是的 /Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 文件确实存在:-)

4

1 回答 1

2

出于某种原因,对我来说似乎解决这个问题的方法实际上是传入要使用的架构。

例如,此命令失败:

/Developer-SDK4/usr/bin/xcodebuild -target ProjectName -configuration Release build PLATFORM_NAME=iphonesimulator BUILDSDK=/Developer-SDK4

但这一个有效:

/Developer-SDK4/usr/bin/xcodebuild -target ProjectName -configuration Release build PLATFORM_NAME=iphonesimulator BUILDSDK=/Developer-SDK4 ARCHS=i386

请注意,这仅在针对模拟器构建时对我来说失败了。针对设备构建似乎工作得很好。

于 2010-06-28T20:59:06.050 回答