how to solve this error : "Undefined symbols for architecture arm64" - ios

I am getting this error continue, and there is no any error in the particular class. Can anyone tell me that how can i fix this error ?
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_MYCLASS", referenced from:
objc-class-ref in MYCLASS.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Press "Cmmand+Shift+K" to clean up, and quit Xcode.
delete the cache
Run "rm -rf ~/Library/Developer/Xcode/DerivedData" in terminal
open the project and re-build it

You need to add necessary framework to your project. Check all third party party framework and search its required framework for support. For eg if you add google analytic then you need to add CoreData , Foundation etc framework. There is some framework is missing for which third party framework needs.

I think the error says you have not defined a member function of the class.
In my case I forgot to define the constructor function and got this error. It usually depends on the compiler that you are using, for some compliers this error is not seen.

Related

IMFPush Bluemix not working on Swift 2.2 (i386 error)

Anyone knows how to solve this error? I can't compile my project with IMFPush library =/
ld: warning: ignoring file /Users/kersul/Develop/Grabit_iOS/Pods/IMFPush/Frameworks/IMFPush.framework/IMFPush,
missing required architecture i386 in file
/Users/kersul/Develop/Grabit_iOS/Pods/IMFPush/Frameworks/IMFPush.framework/IMFPush
(2 slices) Undefined symbols for architecture i386:
"_OBJC_CLASS_$_IMFPushClient", referenced from:
type metadata accessor for __ObjC.IMFPushClient 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)
There are a few questions around that seem to tackle this issue.
I would first take a look at Jordan's advice here
and ensure that the framework was added to your project correctly. Additionally ensure that the framework has been linked correctly
If neither fixes the issue then also see the answer posed by Allen and check to see if your .m file is listed under your compile sources.
That said, i386 architecture is what is used by the iOS Simulator. Do be aware that the Simulator cannot replicate push functionality, so even if you are able to compile IMFPush for it, it will not function correctly.

Apple Mach-O Linker Error with project from GitHub

I'm attempting to run a project from git hub (https://github.com/dulaccc/DPMeterView). The issue arises after cloning the repository and using 'pod install' to install the dependencies. I'm receiving this error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_DPMeterView", referenced from:
objc-class-ref in ViewController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code
1 (use -v to see invocation)
I'm having a tough time finding a solution. Any thoughts? Thanks in advance!
Since the obvious solution hasn't been written as an answer, I will do that.
Anytime you get an "undefined symbol" error, that indicates that you have not told the linker to add that symbol to your binary. How do you tell the linker to add it? Well, perhaps the easiest way is to tell the compiler to build your source file.
In Xcode, this is done in the Compile Sources pane, which looks like this:
On the command line, you can do it like this:
clang source1.c source2.c source3.c etc.c
For https://github.com/dulaccc/DPMeterView,
The example project is missing $(inherited) under "Other Linker Flags"
Once you add $(inherited), run pod install and it should compile afterwards.

Apple Mach-O Linker Error during profile

So I ran into this wierd issue where I am able to compile and run my iOS project in simulator with out any issues but when I ran it for profiling with instrument (cmd + I) I am getting Apple mach o linker error for one of the library. I tried it reading to project but it did not helped. I also checked my search paths which looks as following
Other Linker Flags: -ObjC -all_load
Always Search User Paths: No
Framework Search Paths:$(SRCROOT) recursive
Library Search Paths:$(SRCROOT) recursive
I am getting following error message:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_TestFlight", 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)
Am I missing anything in my linking phase which causing this thing to happen ?
It's not finding the TestFlight library. Easiest way to fix that is to find libTestFlight.a in the Xcode project browser and make sure your app is checked under "Target Membership" on the far right pane.

Another "Symbol(s) not found for architecture i386" Error - XMPPFramework

I just added XMPPFramework to my existing Xcode project.
I think I have done all the required things to build it, but when I try to build, I get linker errors as followings :
"_OBJC_CLASS_$_CLLocation", referenced from:
objc-class-ref in XMPPvCardTemp.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 read similar questions and I know it usually occurs because of not linking a required library or framework with the binary, but I have checked everything I knew that is required ( I also done everything on the documentation : https://github.com/robbiehanson/XMPPFramework/wiki/GettingStarted_iOS )
But dependencies and frameworks seem to be linked correctly:
I'm also sure about the fact that I have added XMPPvCardTemp.m to the list of Compile Sources :
and I'm also sure that I have added it to my target :
But I still get this error.
Any suggestions ?
From the screen shot of the error it seems like you did not add core location framework . Recheck May be you have missed it.
Also I see that you are trying to run it on simulator. I have seen some frameworks which could be run only on devices

SenTestCase linker error iOS

I'm trying to write test cases for my iOS app. However, there seems to be some problem regarding SenTesting framework. I'm getting the following error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SenTestCase", referenced from:
_OBJC_CLASS_$_testSmartDiary in testSmartDiary.o
_OBJC_CLASS_$_testAddTask in testAddTask.o
_OBJC_CLASS_$_testAddContacts in testAddContacts.o
"_OBJC_METACLASS_$_SenTestCase", referenced from:
_OBJC_METACLASS_$_testSmartDiary in testSmartDiary.o
_OBJC_METACLASS_$_testAddTask in testAddTask.o
_OBJC_METACLASS_$_testAddContacts in testAddContacts.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I don't know what is going wrong. I have added the SenTestingFramework. It is probably happening because I'm using two different machines to develop the same project. Do I need to specify some path? I read the solution given here: iOS: Linker errors with OCUnit integration
but it is not feasible to delete the target and add the things again every time I switch machines. Is there a permanent solution to this? Please help

Resources