gpt4 book ai didi

ios - Apple Mach-O Linker Error 主可执行文件的隐式输入/启动

转载 作者:行者123 更新时间:2023-11-29 10:28:37 25 4
gpt4 key购买 nike

当我试图运行我的应用程序时,我遇到了这个奇怪的错误。我已经多次运行我的应用程序并且运行良好。在我向其中一个 segues 添加标识符后,发生了此错误。当我点击 segue 时,xcode 变得很慢,我可能把标识符放在了错误的地方,或者删除了我不应该拥有的东西。当我单击名称中的 segue 时,有 main.m 或 main.h 不记得是哪个。我把它误认为是标识符并试图删除它以便我可以命名标识符。延迟消失后,该选项也消失了。现在我不知道该怎么办。

错误信息:

Ld /Users/life/Library/Developer/Xcode/DerivedData/MatrixGame-    empjzfoeajzkidevdewazcmxapsv/Build/Products/Debug-iphonesimulator/MatrixGame.app/MatrixGame normal x86_64
cd /Users/life/Desktop/MatrixGame
export IPHONEOS_DEPLOYMENT_TARGET=8.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -L/Users/life/Library/Developer/Xcode/DerivedData/MatrixGame-empjzfoeajzkidevdewazcmxapsv/Build/Products/Debug-iphonesimulator -F/Users/life/Library/Developer/Xcode/DerivedData/MatrixGame-empjzfoeajzkidevdewazcmxapsv/Build/Products/Debug-iphonesimulator -filelist /Users/life/Library/Developer/Xcode/DerivedData/MatrixGame-empjzfoeajzkidevdewazcmxapsv/Build/Intermediates/MatrixGame.build/Debug-iphonesimulator/MatrixGame.build/Objects-normal/x86_64/MatrixGame.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.1 -Xlinker -dependency_info -Xlinker /Users/life/Library/Developer/Xcode/DerivedData/MatrixGame-empjzfoeajzkidevdewazcmxapsv/Build/Intermediates/MatrixGame.build/Debug-iphonesimulator/MatrixGame.build/Objects-normal/x86_64/MatrixGame_dependency_info.dat -o /Users/life/Library/Developer/Xcode/DerivedData/MatrixGame-empjzfoeajzkidevdewazcmxapsv/Build/Products/Debug-iphonesimulator/MatrixGame.app/MatrixGame

Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

最佳答案

在你的项目中添加一个新的.m文件,命名为main

并在其中添加如下代码:

#import <UIKit/UIKit.h>
#import "AppDelegate.h"

int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

同样在您的项目中也缺少 info.plist,因此您需要添加一个新的。

希望对你有帮助

关于ios - Apple Mach-O Linker Error 主可执行文件的隐式输入/启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30866351/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com