macos - SwiftUI MacOS 给出错误 : Undefined symbol: _main

标签 macos swiftui program-entry-point

我下载了一个使用 Xcode 版本 12.0 Beta 6、MacOS BigSur 版本 11.0 Beta 构建的 SwiftUI 源代码。我的系统是 MacOS Catalina,Xcode 版本 12.0.1。

在编译时,我遇到了很多转换错误,其中一个是 AppDelegate.swift 中存在的@main 属性

我删除了变量并构建了导致以下错误的应用程序:

错误: undefined symbol :_main

体系结构 x86_64 的 undefined symbol : “_main”,引用自: 主可执行文件的隐式入口/启动

最佳答案

要解决上述问题,请将 AppDelegate.swift 中的@main 属性替换为@NSApplicationMain 属性。

关于macos - SwiftUI MacOS 给出错误 : Undefined symbol: _main,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64403304/

相关文章:

ios - SwiftUI:添加核心数据项时更新选项卡栏角标(Badge)

java - eclipse 错误 "Could not find or load main class"

ios - AES-256 加密和 Apple iTunes 导出限制

python - 如何加载 dylib 文件作为 CPython 扩展?

swiftui - 如何在 SwiftUI 中传递进度值(也许使用组合)?

ios - 如何在 SwiftUI 中保留 View 结构列表?

interface - 无法打开 Main.Storyboard

主线程中的 Java 异常 - ClassNotFoundException

python - 导入错误 : No module named mandrill

java - 读取/写入 pbxproj/xcodeproj 文件的库?