Theos开发application时 报这个错误: Undefined symbols for architecture armv7

Undefined symbols for architecture armv7:
"OBJC_CLASS$SBIconView", referenced from:
objc-class-ref in XCFirstViewController.m.4aca8a7b.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [/Users/mac/Desktop/逆向开发/xiake_new_jixu_test_1_slices/XiakeControl/.theos/obj/debug/armv7/XiakeControl.app/XiakeControl] Error 1
make[2]: *** [/Users/mac/Desktop/逆向开发/xiake_new_jixu_test_1_slices/XiakeControl/.theos/obj/debug/armv7/XiakeControl.app/XiakeControl] Error 2
make[1]: *** [internal-application-all
] Error 2
make: *** [XiakeControl.all.application.variables] Error 2
tz-macs-MacBook-Air:XiakeControl mac$

https://www.google.com/search?num=20&newwindow=1&q=Undefined+symbols+for+architecture+armv7&oq=Undefined+symbols+for+architecture+armv7&gs_l=psy-ab.3..0l4.4061.4061.0.4324.1.1.0.0.0.0.176.176.0j1.1.0....0...1.1.64.psy-ab..0.1.176.5JcRZWPtNkI

https://stackoverflow.com/questions/6429494/undefined-symbols-for-architecture-armv7

不行吧,你说的是ios正向问题 遇到这个错误的解决办法

%c(XXXClass) ?

什么意思?

本质上没有区别

但是这个theos创建的application工程,我又不能用xcode打开,然后我怎么弄呢…= =

theos Undefined symbols for architecture armv7

你自己说的话, 拿去GOOGLE就有答案了…

https://www.google.com/search?ie=UTF-8&q=theos+Undefined+symbols+for+architecture+armv7

https://www.reddit.com/r/jailbreakdevelopers/comments/41bsh0/error_in_theos_undefined_symbols_for_architecture/

2楼的SO已经回答得很清楚了, 如果你还是没懂, 我再30字说明一下, 你只提供了声明, 而没有具体实现, 所以才会有undefined symbols

出现这个问题是因为不识别 “_SBIconView” 这个类
我今晚遇到奇葩的问题是 我第一次这样写不管用,折腾了一个小时后又回到这样,竟然可以用了…尴尬
NSClassFromString(@“MomoMaskView”)

弄明白了 对于引用的其他类 首先要声明

@interface MomoMaskView : UIView

然后在调用时还不能直接用类名,要用NSClassFromString(@“MomoMaskView”)

亲测这样的组合可用.

2 个赞