So today I ran into a major problem. I got a problem involving my viewcontroller on xcode 4.3.2 as seen in this error message:
Undefined symbols for architecture i386: "_OBJC_CLASS_$_SecondViewController",
referenced from: objc-class-ref in Birdflix_ProViewController.o "_OBJC_CLASS_$_ThirdViewController",
referenced from: objc-class-ref in Birdflix_ProViewController.o "_OBJC_CLASS_$_FourthViewController",
referenced from: objc-class-ref in Birdflix_ProViewController.o "_OBJC_CLASS_$_Author",
referenced from: objc-class-ref in Birdflix_ProViewController.o
ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I noticed that these errors only appear when I program IBActions linking my viewcontroller to additional classes. If I delete the IBActions the errors disappear. Any help is appreciated.
Finally found the answer. In your target settings, locate build phases and navigate to compile sources. Once there just ad the .m file that is getting the error to the list.
For me the following method worked.
In target -> Build Phases -> Compile Sources I had all .m files including those that were giving issue.
Simply I removed those .m files which were giving issue.
Related
I'm trying to implement ios-oauthconsumer
but I'm getting this error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_OAMutableURLRequest", referenced from:
objc-class-ref in ViewController.o
"_OBJC_CLASS_$_OAConsumer", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I tried to add the files following this solution but Xcode re-adds the file to the project. For example:
Any of you knows a way were I can add the files to the "Compile Sources" without having to re-add the file?
I'll really appreciated you help.
Make sure that each source file that needs to be linked is part of the Compile Sources section of your target. You can verify this by selecting your project in Navigator pane (as shown in your screenshot) and expanding the section shown here:
Xcode Compile Sources
You can also verify this by selecting the files and viewing their target membership in the Utilities pane in xcode.
Target Membership
I updated my cocoapods version to 1.0 and am now getting a slew of errors regarding architecture. This is what my errors look like:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_Reachability", referenced from:
objc-class-ref in ReachabilityManager.o
(maybe you meant: _OBJC_CLASS_$_ReachabilityManager)
"_OBJC_CLASS_$_PBJVision", referenced from:
objc-class-ref in NewSpinViewController.o
"_PBJVisionPhotoImageKey", referenced from:
-[NewSpinViewController vision:capturedPhoto:error:] in NewSpinViewController.o
"_kReachabilityChangedNotification", referenced from:
-[NoInternetViewController viewDidLoad] in NoInternetViewController.o
"_PBJVisionPhotoThumbnailKey", referenced from:
-[NewSpinViewController vision:capturedPhoto:error:] in NewSpinViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've spent hours trying to fix this by toggling settlings under build settings but nothing is working for me.
This is what I currently have for my Architectures
Anyone have any ideas?
Try this: delete derived data and compile again. Sometimes the pod libraries simply don't get compiled even you cleaned the project, this happened to me when I updated to cocoapods 1.0.1.
I'm attempting to use the Branch.io iOS SDK in my iOS app, and I'm getting the following error when I try to compile:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_CSSearchableIndex", referenced from:
objc-class-ref in BranchCSSearchableItemAttributeSet.o "_OBJC_CLASS_$_CSSearchableItem", referenced from:
objc-class-ref in BranchCSSearchableItemAttributeSet.o "_OBJC_CLASS_$_CSSearchableItemAttributeSet", referenced from:
_OBJC_CLASS_$_BranchCSSearchableItemAttributeSet in BranchCSSearchableItemAttributeSet.o
"_OBJC_METACLASS_$_CSSearchableItemAttributeSet", referenced from:
_OBJC_METACLASS_$_BranchCSSearchableItemAttributeSet in BranchCSSearchableItemAttributeSet.o ld: symbol(s) not found for
architecture x86_64 clang: error: linker command failed with exit code
1 (use -v to see invocation)
As the tutorial described, I have the Branch-SDK folder correctly added to the project, I configured the PLST, and added all the code in the AppDelegate.m. I skipped step 3 for enabling universal links, because I won't need that yet.
What am I missing that could be causing this? For this sort of error with other frameworks, it tends to be caused by incorrect declaration of the class, but I don't see where I'm doing that incorrectly.
For me within the Podfile uncommenting the following line and rerunning the installation resolved this kind of issues in XCode:
use_frameworks!
And do a
pod install
And try cleaning and running the app in XCode once again and it should work.
It worked for me.
I am working on translation App for that i use marketplace azure and its client and so on ,in that app only i am using ocr tesseract for text scanning then apply translation as translate in required in language,
i am getting an bellow error
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_AFHTTPRequestOperation", referenced from:
objc-class-ref in FGTranslateRequest.o
"_OBJC_CLASS_$_AFJSONResponseSerializer", referenced from:
objc-class-ref in FGTranslateRequest.o
"_OBJC_CLASS_$_AFXMLParserResponseSerializer", referenced from:
objc-class-ref in FGTranslateRequest.o
"_OBJC_CLASS_$_TMCache", referenced from:
objc-class-ref in FGTranslator.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
guide me ...
This type of errors normally occurs if your class' .m file is not listed under the "Compile Sources". Normally it's done by xcode but if there is any target related problem it fails to do it.
Steps:
TargetSettings -> Build Phases -> Compile Sources -> Add Your .m Class ->Build and Run
I hav a custom class which is a subclass of UIControl.
Unfortunately i am not able to compile the code due to following error:
Unknown class MHRotaryKnob in Interface Builder file.
I have tried to add the MHRotaryKnob.m in Build Phases -> Compile Sources i just got a bunch of errors:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CAKeyframeAnimation", referenced from:
objc-class-ref in MHRotaryKnob.o "_OBJC_CLASS_$_CAMediaTimingFunction", referenced from:
objc-class-ref in MHRotaryKnob.o "_kCAMediaTimingFunctionEaseIn", referenced from:
-[MHRotaryKnob valueDidChangeFrom:to:animated:] in MHRotaryKnob.o "_kCAMediaTimingFunctionEaseOut", referenced from:
-[MHRotaryKnob valueDidChangeFrom:to:animated:] in MHRotaryKnob.o ld: symbol(s) not found for architecture i386 clang:
error: linker command failed with exit code 1 (use -v to see
invocation)
I have tried to clean and rebuild
I have sweeped content off my simulator
I assume from searching on this particular error its due to the missing sourcefile in my build phase.
Thanks in advance.
A missing framework (QuartzCore) was added, and the problem was solved.