0

这是警告消息出现,当我编译我的WatchKit 2应用WatchSimulator 3.1 SDK不支持x86_64体系结构?

忽略文件 /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator3.1.sdk /System/Library/Frameworks//WatchKit.framework/WatchKit, 文件是为i386而建的,它不是被链接的体系结构 (x86_64): /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/ SDK/WatchSimulator3.1.sdk/System/Library/Frameworks // WatchKit.framework/WatchKitld: warning:忽略文件 /Applications/Xcode.app/Contents/Developer/Platforms/ WatchSimulator.platform/Developer/SDKs/WatchSimulator3.1.sdk/System/Library/Frameworks // Foundation.framework/Foundation, file is built for i386 which is not the architecture being linked (x86_64): /Applications/Xcode 。应用程序/内容/开发/平台/ WatchSimulator.platform /开发商/软件开发工具包/ WatchSimulator3.1.sdk /系统/库/框架// Foundation.framework /基金会

最后,它无法编译

ld:入口点(_main)未定义。 for architecture x86_64

构建设置中的架构限制为:i386和x86_64。但是,如果我只强制架构到x86_64(我不想永久申请我的项目)。还有一种错误

LD:非法文本搬迁“non_lazy_ptr”在

我加入OTHER_CFLAGS = $(inherited) -read_only_relocs suppress从计算器中的一些答案建议。 但Xcode保持相同的错误信息。

编辑:哦,我的另一个错误。这应该是OTHER_LDFLAGS = ...的东西。

任何人都可以给我任何理想的如何克服这一点。

非常感谢,

回答

0

我想出了问题。

因为我错误地将WatchKit扩展的架构设置为WatchSimulator为i386 x86_64。 Xcode自动选择x86_64。

但是,Watch Simulator SDK不支持x86_64。因为目前所有的手表操作系统都只为32位架构而构建。

从架构设置中删除x86_64之后,Xcode使用i386架构构建了我的目标。

然后警告和错误消失。

非常感谢,

+0

这是正确的。所有Apple Watch设备都是32位的。 – russbishop

相关问题