I am getting a Apple Mach-O Linker Error everytime I import a file from CocoaPods.
Undefined symbols for architecture arm64:
\"_OBJC_CLASS_$_FBSession\", r
If the architecture and linker settings look good, check your h files. My issue was the same error, but I had restructured the h files and I removed an extern statement. Other m files were using that variable, causing the linker error.
I have facing the same problem after installing the AWS framework to overcome this issue,I have update the POD config file from your project which get created after installing AWS POD. Check config file as below
OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-AWSAutoScaling" -l"
Pods- AWSCloudWatch" -l"Pods-AWSCognito" -l"Pods-AWSCore" -l
"Pods-AWSDynamoDB" -l"Pods-AWSEC2" -l"Pods-AWSElasticLoadBalancing"
-l"Pods-AWSKinesis" -l"Pods-AWSLambda" -l"Pods-AWSMachineLearning"
-l"Pods-AWSS3" -l"Pods-AWSSES" -l"Pods-AWSSNS" -l"
Pods-AWSSQS"-l "Pods-AWSSimpleDB" -l"Pods-Bolts" -l"Pods-FMDB"
-l"Pods-GZIP" -l"Pods-Mantle" -l"Pods-Reachability" -l"Pods-TMCache"
-l"Pods-UICKeyChainStore" -l"Pods-XMLDictionary" -l"sqlite3" -l
"z"-framework "Accelerate" -framework "AssetsLibrary"
-framework "CoreLocation" -framework "Foundation" -framework
"ImageIO" -framework "Security" -framework "SystemConfiguration"
-framework "UIKit" -weak_framework "UIKit"
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
if your config file not working properly then Set your Other Linker flag to $(inherited)
Set Architectures to armv7 armv7s, Build Active Architecture Only to NO, for every target in the project, including every one in Pods
As morisunshine answer pointed in right direction, a little tweak in his answer solved my problem for iOS8.2 .Thanks to him.
I solved this problem by setting that:
ARCHS = armv7
VALID_ARCHS = armv6 armv7 armv7s arm64
BUILD ACTIVE ARCHITECTURE ONLY= NO
This might be related to libz.dylib
or libz.tbd
, just have to add it to your targets for the linking binaries, and try to compile again.
in some case, if you define one more interface in a .h file, but did not implementation all these interface, this error occurred.
The linker can't found the implementation in .m file, so you need to implementation it in your .m file for every interface.
To resolve this error:
1.in .m file, supply the implementation for each interface. 2.rebuild