ios - ld : entry point (_main) undefined. 架构 x86_64:Xcode 9

标签 ios swift xcode

最近我下载了 Xcode 9 并创建了一个示例 iPhone 应用程序,但该应用程序无法构建,因为它显示以下错误:

ld: entry point (_main) undefined. for architecture x86_64

我在网上搜索了同样的内容并尝试了几种方法,例如删除派生数据,重新启动 Xcode,但仍然没有解决问题。

有人遇到过类似的问题吗?

最佳答案

添加 @main 解决了这个问题。

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
...
}

@UIApplicationMain 早于 Swift 5.3

关于ios - ld : entry point (_main) undefined. 架构 x86_64:Xcode 9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46648834/

相关文章:

swift - 如何更改 xcode 项目中的导航标题按钮文本

在 iPad 上运行的 iPhone 应用程序 : rootViewController not the tabBarController as it is when running on iPhone

ios - Swift:如何将按钮添加到 InAppSettingsKit 设置 View (iPhone/iPad)?

ios - Swift 中不同时间间隔刷新 TableView Cell 从 URL 获取数据

ios - AFNetworking 不工作

MacOS 上的 Swift - 如何将 NSImage 保存到磁盘

ios - 如何用一根手指旋转 Sprite 节点 “touch and drag”

cocoa - 在一个项目中构建两个可执行文件

iphone - 如何一键同时控制两个 UIScrollView?

ios - Phonegap 内嵌视频无法正常工作,但设置正确