Error "_OBJC_CLASS _ $ _ AppDelegate" referenced by: "and error: linker command with exit code 1 worked (use -v to call the call)"

I am new to development and I got this error, I am not shire if I have something missing in my AppDelegate files, so I will show you the files.

h file

#import <UIKit/UIKit.h> @interface AppDelegate: UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end 

m file

 #import "AppDelegate.h" 

The fact is that I think that I deleted something from the te m file, but I can’t remember what it was.

here is the complete error message:

Undefined characters for x86_64 architecture: "_OBJC_CLASS _ $ _ AppDelegate" referenced: objc-class-ref in main.o ld: character (s) not found for x86_64 architecture clang: error: linker command failed with exit code 1 (use -v to call the call)

+6
source share
1 answer

You need to make sure that your AppDelegate.m added to the "Compilation Sources" in your target settings.

To do this, click on the project (top left in the Xcode window) β†’ Go to the Phase Assembly tab β†’ Compile Sources , and then check AppDelegate.m actually added to the list. If not, click + β†’ Type AppDelegate.m β†’ Select, and then Add . It has to be done.

+12
source

Source: https://habr.com/ru/post/975476/