错误编译TWEAK在THEOS(Error compiling tweak in theos)

2019-06-25 04:26发布

我使用教程以下狄奥设置一个简单的调整在这里 。 然而,当我运行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佩特里奇的甩了头,所以我清空了包括文件夹,并把他的头在跑做,以此为输出

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

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

Answer 1:

我发现了同样的问题,瑞安佩特里奇今天倾倒头的当前版本。

最后我发现,解决的办法是,

  1. 导入倾倒跳板头

  2. 复制/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h到/ opt /狄奥/包括/ IOSurface。 究其原因,IOSurface / IOSurface.h!

  3. 如果您正在运行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);

试试看!



Answer 2:

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

1)获取的头-用谷歌搜索“瑞安佩特里奇的甩了头”,这将导致你: https://github.com/rpetrich/iphoneheaders

2)使用git克隆回购:混帐克隆https://github.com/rpetrich/iphoneheaders

3)运行make(我发现我需要运行作出须藤使由于在/ opt安装THEOS的位置。)

4)对于每一个“未找到错误文件”我复制了包含文件到我的项目。

5)我相信你应该在你的项目文件夹中的以下文件夹结束:AccountSettings由于IOKit跳板ActorKit IOSurface TelephonyUI AppSupport JavaScriptCore的Tutorial.plist Availability2.h MIME Tweak.xm ChatKit的Makefile Tweak.xm.original的CoreFoundation UIKit中的MediaPlayer CoreGraphics的消息的WebCore DAVKit MessageUI WebKit的数据访问MusicLibrary控制基金会PhotoLibrary OBJ GraphicsServices QuartzCore狄奥

6)你需要从上面的“复制/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h到/ opt /狄奥/包括/ IOSurface,原因是IOSurface / IOSurface.h答案做#2 !”

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);

周围的行号二百五十三分之二百五十二FYI我IOSurfaceAPI.h这些都是线



Answer 3:

你并不需要导入倾倒跳板头。



文章来源: Error compiling tweak in theos