我已按照本教程 LINK
但是当我将 lib 及其 .h 添加到项目时出现链接器错误。
我搜索了谷歌,我发现应该在设置中添加-ObjC和-all_load 我做了但错误无法解决。错误如下:
ld: warning: ignoring file /Users/techvedika/Desktop/RND/MathTest/MathTest/iCodeBlogsMathLibrary/libICodeMathUtils.a, missing required architecture i386 in file /Users/techvedika/Desktop/RND/MathTest/MathTest/iCodeBlogsMathLibrary/libICodeMathUtils.a (3 slices) Undefined symbols for architecture i386: "_OBJC_CLASS_$_MathFunctions", referenced from: objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
我该如何解决这个问题?
最佳答案
你能检查一下lipo -info libICodeMathUtils.a
在终端上。如果它没有列出架构 i386,则意味着您的库不是为模拟器构建的。它不适用于模拟器
关于ios - 在 proj 中使用 lib 文件时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22091680/