gpt4 book ai didi

ios - Swift:Apple Mach-O 链接器错误(文件对于架构 x86_64 而言太小)

转载 作者:IT王子 更新时间:2023-10-29 05:03:53 27 4
gpt4 key购买 nike

我正在创建一个从网站获取信息的天气应用程序。上次我编码时(昨晚)一切都很好,我能够毫无错误地编译和运行模拟器。就在今天,当我启动同一个项目时,没有做任何更改,我收到了“Apple Mach-O Linker Error”。请大家帮忙解决一下好吗?

错误详情如下:

Ld /Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Products/Debug-iphonesimulator/Haze\ Meter.app/Haze\ Meter normal x86_64
cd "/Users/Allister/Documents/XCODE/Haze Meter"
export IPHONEOS_DEPLOYMENT_TARGET=8.3
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.3.sdk -L/Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Products/Debug-iphonesimulator -F/Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Products/Debug-iphonesimulator -filelist /Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Intermediates/Haze\ Meter.build/Debug-iphonesimulator/Haze\ Meter.build/Objects-normal/x86_64/Haze\ Meter.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Intermediates/Haze\ Meter.build/Debug-iphonesimulator/Haze\ Meter.build/Objects-normal/x86_64/Haze_Meter.swiftmodule -mios-simulator-version-min=8.3 -Xlinker -dependency_info -Xlinker /Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Intermediates/Haze\ Meter.build/Debug-iphonesimulator/Haze\ Meter.build/Objects-normal/x86_64/Haze\ Meter_dependency_info.dat -o /Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Products/Debug-iphonesimulator/Haze\ Meter.app/Haze\ Meter

在底部:

ld: file too small (length=0) file '/Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Intermediates/Haze Meter.build/Debug-iphonesimulator/Haze Meter.build/Objects-normal/x86_64/ViewController.o' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我在 StackOverflow 上检查了其他“Apple Mach-O Linker Error”,但它们似乎与我有不同的“ld”,尽管是相同的“clang”。

最佳答案

尝试完全重建/清理。之前的构建可能已异常中止,导致 ViewController.o 文件损坏或大小为零。

要清理:在 Xcode“产品”菜单中,选择“清理”(快捷键:Cmd+Shift+K)

要重建:在 Xcode“产品”菜单中,选择“构建”(快捷键:Cmd+B)

如果不起作用:在 Xcode“产品”菜单中,按住 Option 键,然后选择“清理构建文件夹”

引用自HERE .

关于ios - Swift:Apple Mach-O 链接器错误(文件对于架构 x86_64 而言太小),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30497275/

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