尝试编译 MobileSubstrate 插件 - 未定义的符号
我通过本教程创建了一个 MobileSubstrate 插件。我可以毫无错误地编译示例挂钩。
但是,一旦我添加
#import <SpringBoard/SBAwayController.h>
ExampleHookProtocol.h
和
SBAwayController *awayController = [SBAwayController sharedAwayController];
ExampleHookLibrary.mm
(作为 __$ExampleHook_AppIcon_Launch
函数的第一行),我就得到了尝试 make
时出现以下错误消息(由后一个更改触发):
Undefined symbols:
"_OBJC_CLASS_$_SBAwayController", referenced from:
__objc_classrefs__DATA@0 in ExampleHookLibrary.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [ExampleHook.dylib] Error 1.
SBAwayController 的头文件位于 /var/toolchain/sys30/usr/include/SpringBoard
,就像ExampleHook 使用的SBApplicationIcon.h
一样。
我正在我的 iPod touch 2G 上进行编译。
谁能帮助我吗?
预先感谢,
埃里克
I went through this tutorial to create a MobileSubstrate addon. I could compile the example hook without errors.
But as soon as I add
#import <SpringBoard/SBAwayController.h>
in ExampleHookProtocol.h
and
SBAwayController *awayController = [SBAwayController sharedAwayController];
in ExampleHookLibrary.mm
(as the first line of the __$ExampleHook_AppIcon_Launch
function) I get the following error message when attempting to make
(triggered by the latter change):
Undefined symbols:
"_OBJC_CLASS_$_SBAwayController", referenced from:
__objc_classrefs__DATA@0 in ExampleHookLibrary.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [ExampleHook.dylib] Error 1.
The header file for SBAwayController is located in /var/toolchain/sys30/usr/include/SpringBoard
, just like SBApplicationIcon.h
, which is used by the ExampleHook.
I'm compiling on my iPod touch 2G.
Can anyone help me?
Thanks in advance,
Eric
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于编译时没有任何可链接的内容,因此需要在运行时获取该类,因此添加
初始化程序,并更改
为
Since there is nothing to link to when you compile, you need to get the class at runtime, so add
in the initializer, and change
to
您还可以使用:
You can also use: