错误编译调整在theos

我在这里使用教程设置了一个简单的调整。 但是,当我从这里运行make头,我得到

Making all for tweak WelcomeWagon... Preprocessing Tweak.xm... Compiling Tweak.xm... In file included from Tweak.xm:1: /opt/theos//include/SpringBoard/SpringBoard.h:7:26: error: UIApplication.h: No such file or directory cc1objplus: warnings being treated as errors In file included from /opt/theos//include/SpringBoard/UIApplicationDelegate-Protocol.h:7, from /opt/theos//include/SpringBoard/SpringBoard.h:9, from Tweak.xm:1: /opt/theos//include/SpringBoard/NSObject-Protocol.h:7: warning: duplicate declaration for protocol 'NSObject' In file included from /opt/theos//include/SpringBoard/SpringBoard.h:9, from Tweak.xm:1: /opt/theos//include/SpringBoard/UIApplicationDelegate-Protocol.h:11: warning: duplicate declaration for protocol 'UIApplicationDelegate' /opt/theos//include/SpringBoard/UIApplicationDelegate-Protocol.h:35: error: duplicate property declaration 'window' make[2]: *** [obj/Tweak.xm.o] Error 1 make[1]: *** [internal-library-all_] Error 2 make: *** [WelcomeWagon.all.tweak.variables] Error 2 

经过一番search之后,我也发现有些人使用Ryan Petrich的倾倒标题,所以我清空了include文件夹,并把他的标题放入并运行make,将其作为输出

 Making all for tweak WelcomeWagon... Preprocessing Tweak.xm... Compiling Tweak.xm... In file included from /opt/theos//include/QuartzCore/QuartzCore-Structs.h:11, from /opt/theos//include/QuartzCore/CAValueFunction.h:9, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h:30, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9, from /opt/theos//include/UIKit/UIKit-Structs.h:15, from /opt/theos//include/UIKit/UIGestureRecognizer.h:6, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h:9, from /opt/theos//include/UIKit/UISwipeGestureRecognizer.h:10, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h:11, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h:11, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h:10, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:12, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:10, from /opt/theos//Prefix.pch:4, from <command-line>:0: /opt/theos//include/IOSurface/IOSurface.h:20:36: error: IOSurface/IOSurfaceAPI.h: No such file or directory In file included from /opt/theos//include/IOSurface/IOSurface.h:21, from /opt/theos//include/QuartzCore/QuartzCore-Structs.h:11, from /opt/theos//include/QuartzCore/CAValueFunction.h:9, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h:30, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9, from /opt/theos//include/UIKit/UIKit-Structs.h:15, from /opt/theos//include/UIKit/UIGestureRecognizer.h:6, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h:9, from /opt/theos//include/UIKit/UISwipeGestureRecognizer.h:10, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h:11, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h:11, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h:10, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:12, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:10, from /opt/theos//Prefix.pch:4, from <command-line>:0: /opt/theos//include/IOSurface/IOSurfaceAccelerator.h:20: error: 'IOSurfaceRef' has not been declared /opt/theos//include/IOSurface/IOSurfaceAccelerator.h:20: error: 'IOSurfaceRef' has not been declared In file included from /opt/theos//include/QuartzCore/QuartzCore-Structs.h:11, from /opt/theos//include/QuartzCore/CAValueFunction.h:9, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h:30, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9, from /opt/theos//include/UIKit/UIKit-Structs.h:15, from /opt/theos//include/UIKit/UIGestureRecognizer.h:6, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h:9, from /opt/theos//include/UIKit/UISwipeGestureRecognizer.h:10, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h:11, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h:11, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h:10, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:12, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:10, from /opt/theos//Prefix.pch:4, from <command-line>:0: /opt/theos//include/IOSurface/IOSurface.h:27: error: variable or field 'IOSurfaceFlushProcessorCaches' declared void /opt/theos//include/IOSurface/IOSurface.h:27: error: 'IOSurfaceRef' was not declared in this scope In file included from /opt/theos//include/QuartzCore/CAValueFunction.h:9, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h:30, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9, from /opt/theos//include/UIKit/UIKit-Structs.h:15, from /opt/theos//include/UIKit/UIGestureRecognizer.h:6, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h:9, from /opt/theos//include/UIKit/UISwipeGestureRecognizer.h:10, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h:11, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h:11, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h:10, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:12, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:10, from /opt/theos//Prefix.pch:4, from <command-line>:0: /opt/theos//include/QuartzCore/QuartzCore-Structs.h:196: error: 'IOSurfaceRef' does not name a type In file included from /opt/theos//include/UIKit/UIKit2.h:52, from /opt/theos//include/MessageUI/MessageUI-Structs.h:8, from /opt/theos//include/MessageUI/ComposeRecipient.h:9, from /opt/theos//include/ChatKit/CKMailComposeRecipient.h:6, from /opt/theos//include/ChatKit/ChatKit.h:41, from /opt/theos//include/SpringBoard/SpringBoard-Structs.h:13, from /opt/theos//include/SpringBoard/SpringBoard.h:8, from Tweak.xm:1: /opt/theos//include/UIKit/UIImage2.h:85: error: expected type-specifier before 'IOSurfaceRef' /opt/theos//include/UIKit/UIImage2.h:85: error: expected `)' before 'IOSurfaceRef' /opt/theos//include/UIKit/UIImage2.h:85: error: expected `;' before ')' token /opt/theos//include/UIKit/UIImage2.h:86: error: expected type-specifier before 'IOSurfaceRef' /opt/theos//include/UIKit/UIImage2.h:86: error: expected `)' before 'IOSurfaceRef' /opt/theos//include/UIKit/UIImage2.h:86: error: expected `;' before ')' token /opt/theos//include/UIKit/UIImage2.h:91: error: expected type-specifier before 'IOSurfaceRef' /opt/theos//include/UIKit/UIImage2.h:91: error: expected `)' before 'IOSurfaceRef' /opt/theos//include/UIKit/UIImage2.h:91: error: expected `;' before ')' token In file included from /opt/theos//include/UIKit/UIKit2.h:448, from /opt/theos//include/MessageUI/MessageUI-Structs.h:8, from /opt/theos//include/MessageUI/ComposeRecipient.h:9, from /opt/theos//include/ChatKit/CKMailComposeRecipient.h:6, from /opt/theos//include/ChatKit/ChatKit.h:41, from /opt/theos//include/SpringBoard/SpringBoard-Structs.h:13, from /opt/theos//include/SpringBoard/SpringBoard.h:8, from Tweak.xm:1: /opt/theos//include/UIKit/UIWindow2.h:19: error: expected type-specifier before 'IOSurfaceRef' /opt/theos//include/UIKit/UIWindow2.h:19: error: expected `)' before 'IOSurfaceRef' /opt/theos//include/UIKit/UIWindow2.h:19: error: expected `;' before ')' token /opt/theos//include/UIKit/UIWindow2.h:20: error: expected type-specifier before 'IOSurfaceRef' /opt/theos//include/UIKit/UIWindow2.h:20: error: expected `)' before 'IOSurfaceRef' /opt/theos//include/UIKit/UIWindow2.h:20: error: expected `;' before ')' token /opt/theos//include/UIKit/UIWindow2.h:21: error: expected type-specifier before 'IOSurfaceRef' /opt/theos//include/UIKit/UIWindow2.h:21: error: expected `)' before 'IOSurfaceRef' /opt/theos//include/UIKit/UIWindow2.h:21: error: expected `;' before ')' token /opt/theos//include/UIKit/UIWindow2.h:116: error: expected type-specifier before 'IOSurfaceRef' /opt/theos//include/UIKit/UIWindow2.h:116: error: expected `)' before 'IOSurfaceRef' /opt/theos//include/UIKit/UIWindow2.h:116: error: expected `;' before ')' token /opt/theos//include/UIKit/UIWindow2.h:117: error: expected type-specifier before 'IOSurfaceRef' /opt/theos//include/UIKit/UIWindow2.h:117: error: expected `)' before 'IOSurfaceRef' /opt/theos//include/UIKit/UIWindow2.h:117: error: expected `;' before ')' token make[2]: *** [obj/Tweak.xm.o] Error 1 make[1]: *** [internal-library-all_] Error 2 make: *** [WelcomeWagon.all.tweak.variables] Error 2 

谁能告诉我我做错了什么? 提前致谢。

我今天发现了与当前版本的Ryan Petrich的倾倒标题相同的问题。

最后我发现解决scheme是,

  1. 导入倾销的Springboard标题

  2. 将/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h复制到/ opt / theos / include / IOSurface。 原因是在IOSurface / IOSurface.h!

  3. 如果您正在运行OS X Lion或更高版本,则可能需要在/opt/theos/include/IOSurface/IOSurfaceAPI.h中注释以下行:


     / *这个调用让你得到一个包含IOSurface引用的xpcobject_t。
    注意:通过IOSurfaceRef隐含创build的任何活动XPC对象都会增加IOSurface的全局使用
    数一个,直到对象被销毁。  * /
     // xpc_object_t IOSurfaceCreateXPCObject(IOSurfaceRef aSurface)
     // IOSFC_AVAILABLE_STARTING(_MAC_10_7,__IPHONE_NA);

     / *这个调用可以让你通过IOSurfaceCreatePort()创build一个xpcobject_t,然后重新创build一个IOSurfaceRef。  * /
     // IOSurfaceRef IOSurfaceLookupFromXPCObject(xpc_object_t xobj)
     // IOSFC_AVAILABLE_STARTING(_MAC_10_7,__IPHONE_NA);

试一试!

我今天刚刚做了2013年2月13日,发现上面有些帮助。 有了一点脑力和谷歌的帮助,我发现你需要做的是:

1.)获取标题 – 使用Googlesearch“Ryan Petrich的倾倒标题”,这将导致您: https : //github.com/rpetrich/iphoneheaders

2.)使用git克隆repo:git clone https://github.com/rpetrich/iphoneheaders

3.)运行make(我发现我需要运行make sudo make,因为它们位于/ opt下面)。

4.)对于每个“找不到错误文件”,我将包含文件复制到我的项目中。

5.)我相信你应该最终在你的项目文件夹中的以下文件夹:AccountSettings IOKit SpringBoard ActorKit IOSurface TelephonyUI AppSupport JavaScriptCore Tutorial.plist Availability2.h MIME Tweak.xm ChatKit Makefile Tweak.xm.original CoreFoundation MediaPlayer UIKit CoreGraphics Message WebCore DAVKit MessageUI WebKit DataAccess MusicLibrary控件Foundation PhotoLibrary obj GraphicsServices QuartzCore theos

6)你需要从上面的“Copy /System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h到/ opt / theos / include / IOSurface的答案中做#2,原因是在IOSurface / IOSurface.h !”

7.)您还需要从上面的答案进行编辑“如果您正在运行OS X Lion,则可能需要在/opt/theos/include/IOSurface/IOSurfaceAPI.h中注释以下行:”

 /* This call lets you get an xpcobject_t that holds a reference to the IOSurface. Note: Any live XPC objects created from an IOSurfaceRef implicity increase the IOSurface's global use count by one until the object is destroyed. */ // xpc_object_t IOSurfaceCreateXPCObject(IOSurfaceRef aSurface) // IOSFC_AVAILABLE_STARTING(_MAC_10_7, __IPHONE_NA); /* This call lets you take an xpcobject_t created via IOSurfaceCreatePort() and recreate an IOSurfaceRef from it. */ // IOSurfaceRef IOSurfaceLookupFromXPCObject(xpc_object_t xobj) // IOSFC_AVAILABLE_STARTING(_MAC_10_7, __IPHONE_NA); 

仅供参考IOSurfaceAPI.h这些是行号252/253行

您不需要导入倾倒的Springboard标题。