我下载了一个使用 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/