Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "_OBJC_CLASS_$_AppDelegate", referenced from:" and error: linker command failed with exit code 1 (use -v to see invocation)"

I'm pretty new to developing, and i got this error, I'm not shire if i got something missing in my AppDelegate files so I'm gonna show you the files.

the h-file

#import <UIKit/UIKit.h>


@interface AppDelegate: UIResponder <UIApplicationDelegate>


@property (strong, nonatomic)  UIWindow *window;

@end

the m-file

#import "AppDelegate.h"

the thing is that i think i removed something from te m-file but i can't remember what it was

here is the full error message:

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)

like image 271
Andy Avatar asked Sep 18 '14 09:09

Andy


1 Answers

You will need to make sure that your AppDelegate.m is added under Compile Sources in your target settings.

To do this, click on the project (left upper on your Xcode window) -> Click on Build Phases tab -> Compile Sources and then check to see whether AppDelegate.m is actually added to the list. If not, click + button -> Type AppDelegate.m -> Select and then Add it. That should do.

like image 58
GenieWanted Avatar answered Sep 28 '22 12:09

GenieWanted