背景:用theos编译了一个dylib丢到/usr/lib 然后运行发生错误了
错误记录:
Reason: Incompatible library version: xxxx.dylib requires version 1.0.0 or later, but oooo.dylib provides version 0.0.0
oooo.dylib是theos默认编译的
经过一下午研究,得到如下配置(不要在意研究过程,多次阅读mk源代码的结果)
ARCHS = armv7 armv7s arm64 TARGET = iphone:8.4:7.0 #指定路径,否则默认在 /Library/MobileSubstrate/DynamicLibraries LOCAL_INSTALL_PATH = /usr/bin include theos/makefiles/common.mk TWEAK_NAME = oooo oooo_FILES = oooo.xm #指定版本 _THEOS_TARGET_LDFLAGS += -current_version 1.0 _THEOS_TARGET_LDFLAGS += -compatibility_version 1.0 #tweak2.mk是我修改过的,去掉了CydiaSubstrate链接,因为这个dylib用不到 include $(THEOS_MAKE_PATH)/tweak2.mk -current_version、-compatibility_version参数参考自苹果官方!! https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/CreatingDynamicLibraries.html
已有3位网友发表了看法:
啊
发表评论