iOS静态库编译错误 – 目录为空

前端之家收集整理的这篇文章主要介绍了iOS静态库编译错误 – 目录为空前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试为iOS创建一个Objective C静态库.当我尝试编译它时会发出以下警告.

Libtool /Users/******/Library/Developer/Xcode/DerivedData/MyLib-eyucoczochpovhcqduwoieknpyer/Build/Intermediates/MyLib.build/Debug-iphoneos/MyLib.build/Objects-normal/armv7/libMyLib.a normal armv7
cd /Users/******/Desktop/MyLib
export IPHONEOS_DEPLOYMENT_TARGET=7.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only armv7 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -L/Users/******/Library/Developer/Xcode/DerivedData/MyLib-eyucoczochpovhcqduwoieknpyer/Build/Products/Debug-iphoneos -filelist /Users/******/Library/Developer/Xcode/DerivedData/MyLib-eyucoczochpovhcqduwoieknpyer/Build/Intermediates/MyLib.build/Debug-iphoneos/MyLib.build/Objects-normal/armv7/MyLib.LinkFileList -ObjC -framework Foundation -o /Users/shafraz/Library/Developer/Xcode/DerivedData/MyLib-eyucoczochpovhcqduwoieknpyer/Build/Intermediates/MyLib.build/Debug-iphoneos/MyLib.build/Objects-normal/armv7/libMyLib.a

我也得到了armv7s的类似错误,arm64也是如此

(null): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning for library: /Users/******/Library/Developer/Xcode/DerivedData/MyLib-eyucoczochpovhcqduwoieknpyer/Build/Products/Debug-iphoneos/libMyLib.a for architecture: armv7 the table of contents is empty (no object file members in the library define global symbols)

我也得到了armv7s的类似错误,arm64也是如此

只有在MyLib.h文件删除MyLib.m和类声明后才能显示此蠕虫.

我怎样才能解决这个问题?

解决方法

如果静态库只包含类别或非正式协议,则通常会发生这种情况.链接器警告您似乎没有任何要链接的类.

猜你在找的Xcode相关文章