错误“_OBJC_CLASS_$_AppDelegate",引用自:“和错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)" [英] Error "_OBJC_CLASS_$_AppDelegate", referenced from:" and error: linker command failed with exit code 1 (use -v to see invocation)"

查看:178
本文介绍了错误“_OBJC_CLASS_$_AppDelegate",引用自:“和错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对开发还很陌生,我遇到了这个错误,如果我的 AppDelegate 文件中缺少某些内容,我不会担心,所以我会向您展示这些文件.

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.

h 文件

#import <UIKit/UIKit.h>


@interface AppDelegate: UIResponder <UIApplicationDelegate>


@property (strong, nonatomic)  UIWindow *window;

@end

m 文件

#import "AppDelegate.h"

问题是我想我从 t 文件中删除了一些东西,但我不记得它是什么

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:

体系结构 x86_64 的未定义符号:_OBJC_CLASS_$_AppDelegate",引用自:main.o 中的 objc-class-refld:找不到架构 x86_64 的符号clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

推荐答案

您需要确保您的 AppDelegate.m 添加到目标设置中的编译源下.

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

为此,单击项目(Xcode 窗口的左上角)-> 单击Build Phases 选项卡-> Compile Sources 然后检查是否AppDelegate.m 实际上已添加到列表中.如果没有,请单击 + 按钮 -> 键入 AppDelegate.m -> 选择然后添加.应该可以.

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.

这篇关于错误“_OBJC_CLASS_$_AppDelegate",引用自:“和错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆