Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Static library compilation error - table of contents is empty

I am trying to create a Objective C static library for iOS. When I try to compile it gives following warnings.

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

I am getting similar errors for armv7s, arm64 also

(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)

I am getting similar errors for armv7s, arm64 also

This worming shown only after removing MyLib.m and class declaration in MyLib.h file.

How can I fix this?

like image 837
Shafraz Buhary Avatar asked Mar 19 '23 01:03

Shafraz Buhary


1 Answers

This generally happens if your static library contains nothing but categories or informal protocols. The linker is warning you that you don't seem to have any classes to link.

like image 186
quellish Avatar answered Apr 27 '23 20:04

quellish