按照第二版书上第九章弄微信的项目 编译失败!

我按照书上的代码敲出来的,编译的时候出现
192:wechatrootpro1 yons$ make package install
Making all for tweak WeChatRootPro1…
Preprocessing Tweak.xm…
Compiling Tweak.xm…
Linking tweak WeChatRootPro1…
Undefined symbols for architecture armv7:
“_CGRectZero”, referenced from:
_logos_method$ungrouped$WCContentItemViewTemplateNewSight$onLongTouch(WCContentItemViewTemplateNewSight*, objc_selector*) in Tweak.xm.afac87c6.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [obj/WeChatRootPro1.dylib.ba964c90.unsigned] Error 1
make[1]: *** [internal-library-all
] Error 2
make: *** [WeChatRootPro1.all.tweak.variables] Error 2

附:makefile文件如下:
THEOS_DEVICE_IP = 192.168.0.100
TARGET = iphone:latest:8.3
ARCHS = armv7 arm64

include theos/makefiles/common.mk

TWEAK_NAME = WeChatRootPro1
WeChatRootPro1_FILES = Tweak.xm
WeChatRootPro1_FRAMEWORKS = UIKit

include $(THEOS_MAKE_PATH)/tweak.mk

after-install::
install.exec “killall -9 WeChat”

求指教~谢谢!

另外请问本书中的源码有吗?在哪里下载?我在书中找了个遍没有发现下载的地址~

替换为 CGRectMake(0,0,0,0) 试试

thanks,but why?

我也没深究。再想想……

改成

WeChatRootPro1_FRAMEWORKS = UIKit CoreGraphics

试试

2 个赞

CGRect系列的函数属于CoreGraphics框架,所以要导入此框架,谢谢你 :sunny: