我在here教程之后使用theos进行了简单的调整。但是,当我使用here的标头运行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

经过一番搜索后,我还发现有些人正在使用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的转储标题存在相同的问题。

最后我发现解决方案是

  • 导入转储的跳板标题
  • 将/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h复制到/ opt / theos / include / IOSurface。原因是在IOSurface / IOSurface.h中!
  • 如果您正在运行OS X Lion或更高版本,则可能需要在/opt/theos/include/IOSurface/IOSurfaceAPI.h中注释掉以下行:

  • / *通过此调用,您可以获得一个xpcobject_t,其中包含对IOSurface的引用。
    注意:从IOSurfaceRef创建的任何 Activity XPC对象都会隐式增加IOSurface的全局使用量
    直到对象被销毁为止再加一。 * /
    // xpc_object_t IOSurfaceCreateXPCObject(IOSurfaceRef aSurface)
    // IOSFC_AVAILABLE_STARTING(_MAC_10_7,__IPHONE_NA);

    / *此调用使您可以获取通过IOSurfaceCreatePort()创建的xpcobject_t,并从中重新创建IOSurfaceRef。 * /
    // IOSurfaceRef IOSurfaceLookupFromXPCObject(xpc_object_t xobj)
    // IOSFC_AVAILABLE_STARTING(_MAC_10_7,__IPHONE_NA);

    试试看!

    关于ios - 在theos中编译调整时出错,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10891846/

    10-10 20:48