Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_AppDelegate", referenced from: objc-class-ref in main.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 am trying to use SWRevealViewController in my project, it gives above error.
I dragged and dropped both files i.e. SWRevealViewController.h and SWRevealViewController.m in my project.
If you are using these files in swift project then please make sure #import "SWRevealViewController.h" in your Bridging Header file.
Updated:
Please follows the below steps;
click on the your project name -> Click on Build Phases tab -> Compile Sources and then check to see whether SWRevealViewController.m is actually added to the list. If not, click + button -> Type SWRevealViewController.m -> Select and then Add it.
After that clean the project then again build and run.
Enjoy..!
Related
From this link MediaLibDemos3x , I downloaded source code and I am running it in X-Code 6.3.2 but I am getting following two errors . Can any one check it please give me a solution?
Error 1-
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_BroadcastStreamClient", referenced from:
objc-class-ref in ViewController.o
Error 2-
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It seems the included library are not compiled for i386 (or simulators) so you must run code on real device. See author comment here and here
Undefined symbols for architecture i386
You can get this type of error if your class' .m file is not listed under the "Compile Sources" step of the "Build Phases" tab of your target.
To do this:
Target Settings -> Build Phases -> Compile Sources -> add your .m class ->Build and Run
run your app on device.
I am trying to use SBSRemoteNotificationClient.h file of SpringBoardServices framework downloaded from GitHub. I directly drag and dropped downloaded SBSRemoteNotificationClient.h file into Xcode and tried to compile it. But I am facing below error during compiling.
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_SBSRemoteNotificationClient", referenced from:
objc-class-ref in MyClass.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I added #import "SBSRemoteNotificationClient.h" to my MyClass.m file.I also added path of SBSRemoteNotificationClient.h in Build Settings -> Search paths -> User Header Search paths like this /Users/awsuser006/Desktop/iphone-private-frameworks-master/SpringBoardServices/
But I am facing above mentioned error. Is this the right way of using .h files of private frameworks?
This is a linker error. The header was correctly parsed, but the framework symbols were not found. Make sure you are linking the SpringBoardServices framework.
Use
find /Applications/Xcode.app/ -name 'SpringBoardServices.framework'
to find it, then add -framework SpringBoardServices and -F /the/path/returned/by/find/ (without SpringBoardServices.framework at the end of the path) to your compilation flags.
Adding the framework using Build Phases > Link Binary With Libraries > (+) in your Xcode project may also work.
Find the framework symbols
Drag & drop them into Link with binaries...
I have a static library that I use on a number of different projects and have recently run into a linker error when refactoring it to split a class in two subclasses.
The error is:
"_OBJC_CLASS_$_APIServiceManager", referenced from:
objc-class-ref in libAPIServices.a(APIAuthenicationService.o)
_OBJC_CLASS_$_APIHTTPRequestServiceManager in libAPIServices.a(APIHTTPRequestServiceManager.o)
objc-class-ref in libAPIServices.a(APIService.o)
_OBJC_CLASS_$_APIJSONRequestServiceManager in libAPIServices.a(APIJSONRequestServiceManager.o)
objc-class-ref in libAPIServices.a(APIJSONRequestServiceManager.o)
"_OBJC_METACLASS_$_APIServiceManager", referenced from:
_OBJC_METACLASS_$_APIHTTPRequestServiceManager in libAPIServices.a(APIHTTPRequestServiceManager.o)
_OBJC_METACLASS_$_APIJSONRequestServiceManager in libAPIServices.a(APIJSONRequestServiceManager.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
where APIServiceManager is the superclass with APIHTTPRequestServiceManager and APIJSONRequestServiceManager being the subclasses.
In the subclasses I'm importing the super using:
#import "APIServiceManager.h"
Click to your project name in Xcode (top left corner) to open project setting than select your project target than in main menu select build phases and in build phases options goto link binary with libraries and add all your static libraries frameworks here.
see screen shot..
I got there in the end, it turned out that I was not including the super class in "Compile Sources" section of the library project
I am new with XCode and iOS. I want to create a BD at a remote web service.
My problem is with this error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CJSONDeserializer", 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 have a target, with the group of project with viewController.h and .m And other group with JSON libraries. Maybe, i have to configure something. I don't know.
It's very similar:
Select the project in the project navigator.
Select the Target in the detail view.
Select the Build Phase tab.
Expand the Compiled Sources section
Add the file CJSONDeserializer.m if it is not present there.
This will hopefully solve your problem
I´m new into OS develop and i try to run an app but got an error
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_MMPDeepSleepPreventer", referenced from:
objc-class-ref in vista.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is the line of the problem
self.timer = [[MMPDeepSleepPreventer alloc] init];
I trying to run this example
http://blog.marcopeluso.com/2009/08/23/how-to-prevent-iphone-from-deep-sleeping/
If this is not a unit test then you need to make sure that MMPDeepSleepPreventer.m is included in your targets compile sources.
Xcode 4 Instructions:
Project Navigator -> "[Project Name]" -> Under Targets select your
target -> Build Phases -> Expand Compile Sources -> Click + at bottom
of Compile sources and add the source file.
If you continue to get similar errors then make sure all the source files are added and that you have added the necessary frameworks form the tutorial. The place to add frameworks also in the Build Phases of your target.
If this is is a unit test see the answer below the accepted one here.