简体   繁体   English

入口点 (_main) 未定义 xcode 6

[英]entry point (_main) undefined xcode 6

I can't for the life of me find a solution to this!我这辈子都找不到解决办法! I'm using Swift.我正在使用斯威夫特。 All of a sudden I get this error:突然间我收到此错误:

Undefined symbols for architecture i386:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture i386

It doesn't matter what simulator/device I try to run for, I still get it:不管我尝试运行什么模拟器/设备,我仍然得到它:

Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64

What is this?!这是什么?! I've almost removed everything from my project.我几乎从我的项目中删除了所有内容。 Ie all frameworks and everything.即所有框架和一切。 It's still there.它仍然存在。

Please help me请帮我

Have this in your AppDelegate.swift:在你的 AppDelegate.swift 中有这个:

import UIKit

@UIApplicationMain @UIApplicationMain

Another cause (not for you but for others searching for an answer) is that AppDelegate.swift is for some reason not included in the app target.另一个原因(不是针对您,而是针对其他寻找答案的人)是AppDelegate.swift由于某种原因未包含在应用程序目标中。 I don't know why that would happen-- I assume it was user error on my part-- but without that you'll get this error, and the cause isn't obvious.我不知道为什么会发生这种情况——我认为这是我的用户错误——但如果没有,你会得到这个错误,原因并不明显。 Make sure the checkbox for the file is checked in the app target.确保在应用程序目标中选中了该文件的复选框。

我有同样的问题,但我只是忘了把@UIApplicationMain放在 AppDelegate.swift 的顶部

我的问题是:“main.m”已删除项目。

My problem was the following.我的问题如下。 I had 2 AppDelegate files.我有 2 个 AppDelegate 文件。 The original one that I wanted to delete, and another one I wanted to add.我想删除的原始一个,以及我想添加的另一个。 I first added the new one to the project and then deleted the old one.我首先将新的添加到项目中,然后删除了旧的。 Following this order created a linker error.按照此顺序创建链接器错误。 It worked when I deleted the new one and added it again to the project.当我删除新的并将其重新添加到项目时,它起作用了。 Cheers干杯

我有同样的错误,发现 main.m 包含在项目文件列表中,但没有在目标成员列表中打勾。

Some of the classes and frameworks(like FB SDK) are not ticked like in the picture.一些类和框架(如 FB SDK)没有像图中那样打勾。 So, I manually ticked(only .m files and frameworks) in all classes and frameworks in the Project Navigator.因此,我在项目导航器中的所有类和框架中手动勾选(仅 .m 文件和框架)。 在此处输入图片说明

If this error come you have two problems:如果出现此错误,您有两个问题:

  1. you comment out (with // ) the appleDelegate.swift , you should uncomment it你注释掉(用//appleDelegate.swift ,你应该取消注释它
  2. you miss the appleDelegate.swift in your project你错过了项目中的appleDelegate.swift

要在 Xcode 12.3 中解决此问题,请将@main属性添加到AppDelegate

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 升级到Unity 4.6.1后的Xcode 6.1.1链接器错误:入口点(_main)未定义。 用于建筑Armv7 - Xcode 6.1.1 Linker Error after Upgrading to Unity 4.6.1: entry point (_main) undefined. for architecture armv7 入口点(_main)未定义。 for architecture x86_64 - 仅限XCode UITesting - entry point (_main) undefined. for architecture x86_64 - XCode UITesting only ld:入口点 (_main) 未定义。 对于架构 x86_64:Xcode 9 - ld: entry point (_main) undefined. for architecture x86_64 : Xcode 9 入口点 (_main) 未定义。 对于 Xcode 中的架构 arm64 错误 - Entry point (_main) undefined. for architecture arm64 error in Xcode Xcode 13 构建失败,“入口点 (_main) 未定义。对于体系结构 arm64” - Xcode 13 failing building with "entry point (_main) undefined. for architecture arm64" QT IOS 链接器错误入口点 (_main) 未定义 - QT IOS linker error entry point (_main) undefined ld:入口点(_main)未定义。 用于架构 arm64 - ld: entry point (_main) undefined. for architecture arm64 XCode 12.3 ld:入口点 (_main) 未定义。 对于架构 x86_64 clang:错误:linker 命令失败,退出代码为 1(使用 -v 查看调用) - XCode 12.3 ld: entry point (_main) undefined. for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Qt XCode iOS入口点 - Qt XCode iOS entry point 添加WatchKit导致链接器错误-拱形arm64的入口点(_main)未定义 - Adding WatchKit cause Linker error - entry point (_main) undefined for arch arm64
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM