Tweak 添加 preference bundle 后编译报错

一个 tweak 本来是正常工作的,但是当在工程中用 theos 自带的模板添加 preference bundle 后,编译报错(长串文件路径我都省略了):

In file included from PreferenceTest.mm:1:
In file included from $theos/include/Preferences/Preferences.h:8:
In file included from $theos/include/Preferences/Preferences-Structs.h:8:
In file included from $theos/include/GraphicsServices/GSEvent.h:37:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/mach/message.h:74:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0/include/stdint.h:63:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/stdint.h:52:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/sys/_types.h:32:
$SDKs/iPhoneOS8.4.sdk/usr/include/sys/cdefs.h:680:2: error:
      Unsupported architecture
#error Unsupported architecture
 ^
In file included from PreferenceTest.mm:1:
In file included from $theos/include/Preferences/Preferences.h:8:
In file included from $theos/include/Preferences/Preferences-Structs.h:8:
In file included from $theos/include/GraphicsServices/GSEvent.h:37:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/mach/message.h:74:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0/include/stdint.h:63:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/stdint.h:52:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/sys/_types.h:33:
$SDKs/iPhoneOS8.4.sdk/usr/include/machine/_types.h:34:2: error:
      architecture not supported
#error architecture not supported
 ^
In file included from PreferenceTest.mm:1:
In file included from $theos/include/Preferences/Preferences.h:8:
In file included from $theos/include/Preferences/Preferences-Structs.h:8:
In file included from $theos/include/GraphicsServices/GSEvent.h:37:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/mach/message.h:75:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/mach/port.h:91:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/mach/boolean.h:73:
$SDKs/iPhoneOS8.4.sdk/usr/include/mach/machine/boolean.h:35:2: error:
      architecture not supported
#error architecture not supported
 ^
In file included from PreferenceTest.mm:1:
In file included from $theos/include/Preferences/Preferences.h:8:
In file included from $theos/include/Preferences/Preferences-Structs.h:8:
In file included from $theos/include/GraphicsServices/GSEvent.h:37:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/mach/message.h:75:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/mach/port.h:92:
$SDKs/iPhoneOS8.4.sdk/usr/include/mach/machine/vm_types.h:35:2: error:
      architecture not supported
#error architecture not supported
 ^
In file included from PreferenceTest.mm:1:
In file included from $theos/include/Preferences/Preferences.h:8:
In file included from $theos/include/Preferences/Preferences-Structs.h:8:
In file included from $theos/include/GraphicsServices/GSEvent.h:37:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/mach/message.h:77:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/mach/kern_return.h:70:
$SDKs/iPhoneOS8.4.sdk/usr/include/mach/machine/kern_return.h:35:2: error:
      architecture not supported
#error architecture not supported
 ^
In file included from PreferenceTest.mm:1:
In file included from $theos/include/Preferences/Preferences.h:8:
In file included from $theos/include/Preferences/Preferences-Structs.h:8:
In file included from $theos/include/GraphicsServices/GSEvent.h:38:
In file included from $SDKs/iPhoneOS8.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:11:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/sys/types.h:78:
$SDKs/iPhoneOS8.4.sdk/usr/include/machine/types.h:37:2: error:
      architecture not supported
#error architecture not supported
 ^
In file included from PreferenceTest.mm:1:
In file included from $theos/include/Preferences/Preferences.h:8:
In file included from $theos/include/Preferences/Preferences-Structs.h:8:
In file included from $theos/include/GraphicsServices/GSEvent.h:38:
In file included from $SDKs/iPhoneOS8.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:11:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/sys/types.h:81:
$SDKs/iPhoneOS8.4.sdk/usr/include/machine/endian.h:37:2: error:
      architecture not supported
#error architecture not supported
 ^
In file included from PreferenceTest.mm:1:
In file included from $theos/include/Preferences/Preferences.h:8:
In file included from $theos/include/Preferences/Preferences-Structs.h:8:
In file included from $theos/include/GraphicsServices/GSEvent.h:38:
In file included from $SDKs/iPhoneOS8.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:17:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0/include/limits.h:37:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/limits.h:64:
$SDKs/iPhoneOS8.4.sdk/usr/include/machine/limits.h:8:2: error:
      architecture not supported
#error architecture not supported
 ^
In file included from PreferenceTest.mm:1:
In file included from $theos/include/Preferences/Preferences.h:8:
In file included from $theos/include/Preferences/Preferences-Structs.h:8:
In file included from $theos/include/GraphicsServices/GSEvent.h:38:
In file included from $SDKs/iPhoneOS8.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:21:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/signal.h:63:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/sys/signal.h:81:
$SDKs/iPhoneOS8.4.sdk/usr/include/machine/signal.h:34:2: error:
      architecture not supported
#error architecture not supported
 ^
In file included from PreferenceTest.mm:1:
In file included from $theos/include/Preferences/Preferences.h:8:
In file included from $theos/include/Preferences/Preferences-Structs.h:8:
In file included from $theos/include/GraphicsServices/GSEvent.h:38:
In file included from $SDKs/iPhoneOS8.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:21:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/signal.h:63:
In file included from $SDKs/iPhoneOS8.4.sdk/usr/include/sys/signal.h:145:
$SDKs/iPhoneOS8.4.sdk/usr/include/machine/_mcontext.h:31:2: error:
      architecture not supported
#error architecture not supported
 ^
In file included from PreferenceTest.mm:1:
In file included from $theos/include/Preferences/Preferences.h:8:
In file included from $theos/include/Preferences/Preferences-Structs.h:8:
In file included from $theos/include/GraphicsServices/GSEvent.h:38:
In file included from $SDKs/iPhoneOS8.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:
In file included from $SDKs/iPhoneOS8.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h:10:
$SDKs/iPhoneOS8.4.sdk/usr/include/libkern/OSByteOrder.h:45:10: fatal error:
      'libkern/machine/OSByteOrder.h' file not found
#include <libkern/machine/OSByteOrder.h>
         ^
11 errors generated.

不管怎么尝试始终是 11 errors generated,求问该怎样解决?(我用的是 rpetrich 的 headers

编译preference bundle报错,是这意思么?

嗯,不管在原来的工程下 make 还是在 preferencebundle 这个 subproject 下 make 都是报这11个错……

那应该是你的preference bundle本身代码问题,你可以看看我在github上开源的LowPowerBanner

可是我用模板创建了Preference bundle以后里面的代码完全不动,直接编译就不通过。我也试了iPhonedevwiki上Preferencebundle的例程,还是一样的问题… : (

没下文了吗?我和楼上错误一样

eOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:11:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include/sys/types.h:75:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include/sys/cdefs.h:680:2: error:
Unsupported architecture
#error Unsupported architecture

请问解决了吗,我看了论坛所有相关帖子,完全没有解决方案

Theos 的git库有两个https://github.com/rpetrich/theos和https://github.com/DHowett/theos。你可以换到rpetrich的版本编译,应该就可以了。

太感谢了,完美解决。

请问 rpetrich的DHowett的有什么区别啊?

你好,我看了这个开源代码,不知道LowPowerBanner.bundle里的LowPowerBanner执行文件是怎么生成的。

怎么设置生成LowPowerBanner.bundle,能否有个详细点的教程,多谢。