0

我的调整有问题,实际上是设置部分。当我“安装包”时,它给了我几十个与首选项相关的错误。

在 Tweak.xm 中默认添加了#import。我在网上为我的 IOS(即 5.1.1)找到的标头没有preferences.h。但即使我自己创建它并将其添加到其余标题中,终端也会给我很多与preferences.h 和其余标题相关的错误。

请告诉我如何摆脱这些错误并通过 Theos 添加一个简单的首选项(设置)。

这是我更改为时得到#import<Preferences/Preferences.h>#import<Preferences/PSListController.h>

Compiling prefs.mm...
In the file included from /var/mobile/greet/theos/include/Preferences/PSListController.h:7,
                     from prefs.mm:1:
/var/var/mobile/greet/theos/include/Preferences/PSViewController.h:7:29: error:     UIViewController.h: No such file or directory
cclobjplus: warnings being treated as errors

In the file included from /var/mobile/greet/theos/include/Preferences/PSController-Protocol.h:7,
                     from /var/mobile/greet/theos/include/Preferences/PSViewController.h:9,
                     from /var/mobile/greet/theos/include/Preferences/PSListController.h:7,
                     from prefs.mm:1:
/var/mobile/greet/theos/include/Preferences/NSObject-Protocol.h:7: warning: duplicate declaration for protocol 'NSObject'
In the file included from /var/mobile/greet/theos/include/Preferences/PSListController.h:7,
                     from prefs.mm:1:
/var/mobile/greet/theos/include/Preferences/PSViewController.h:11: error: expected ';' before '<' token
In the file included from /var/mobile/greet/theos/include/Preferences/PSListController.h:10,
                     from prefs.mm:1:
/var/mobile/greet/theos/include/Preferences/UIActionSheetDelegate-Protocol.h:9: warning: duplicate declaration for protocol 'UIActionSheetDelegate'
In the file included from /var/mobile/greet/theos/include/Preferences/PSListController.h:11,
                     from prefs.mm:1:
/var/mobile/greet/theos/include/Preferences/UIAlertViewDelegate-Protocol.h:9: warning: duplicate declaration for protocol 'UIAlertViewDelegate'
In the file included from /var/mobile/greet/theos/include/Preferences/PSListController.h:13,
                     from prefs.mm:1:
/var/mobile/greet/theos/include/Preferences/UITableViewDataSource-Protocol.h:9: warning: duplicate declaration for protocol 'UITableViewDataSource'
In the file included from /var/mobile/greet/theos/include/Preferences/UITableViewDelegate-Protocol.h:8,
                     from /var/mobile/greet/theos/include/Preferences/PSListController.h:14,
                     from prefs.mm:1:
/var/mobile/greet/theos/include/Preferences/UIScrollViewDelegate-Protocol.h:9: warning: duplicate declaration for protocol 'UIScrollViewDelegate'
In the file included from /var/mobile/greet/theos/include/Preferences/PSListController.h:14,
                     from prefs.mm:1:
In the file included from /var/mobile/greet/theos/include/Preferences/UITableViewDelegate-Protocol.h:10:  warning: duplicate declaration for protocol 'UITableViewDelegate'
make[3]: *** [obj/prefs.mm.88233918.o] Error 1
make[2]: *** [internal-bundle-all ] Error 2
make[1]: *** [prefs.all.bundle.variables] Error 2
make: *** [internal-all] Error 2
4

1 回答 1

1

感谢 Andy Ibanez,这个问题得到了解决。问题在于标头 IOSurfaceAPI.h。此处描述了类似的内容https://github.com/peterhajas/MobileNotifier/issues/316

我正在使用来自 github.com 的 rpetrich 标头,但从未提及文件夹“_fallback”。该文件夹具有 IOSurfaceAPI.h 标头,因此我将其复制到“IOSurface”文件夹。之后一切正常。希望它会帮助有同样错误的人。

于 2013-02-09T21:15:09.243 回答