gpt4 book ai didi

ios/objective-C : error: linker command failed with exit code 1 (use -v to see invocation)

转载 作者:行者123 更新时间:2023-11-29 01:22:56 25 4
gpt4 key购买 nike

对于加载缓慢的 VC,我决定删除所有注释掉的多余代码。在执行此操作之前,我将类中的所有代码复制到 TextEdit 中并将其保存到我的桌面上。然后我开始删除无关的代码,但是因为在删除过程中混合了 //和/* */ 我不小心删除了一个右大括号,导致整个剩余的代码都变成了绿色。

因为我无法立即弄清楚我正确地剪切了哪些内容以及是否剪切了太多内容,所以我决定从备份的textEdit文件中复制全部内容并替换类中的原始代码——或者我是这么想的。但是,这样做之后,应用程序将不再运行,因为它会出现以下错误:

Ld /Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Products/Debug-iphoneos/idaru.app/idaru normal armv7
cd /Users/M/Desktop/War/idaru
export IPHONEOS_DEPLOYMENT_TARGET=7.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -L/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Products/Debug-iphoneos -F/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Products/Debug-iphoneos -filelist /Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/idaru.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.1 -framework MessageUI -framework SystemConfiguration -framework CoreLocation -framework MapKit -framework Social -framework AddressBook -framework Accounts -framework CoreGraphics -framework QuartzCore -framework CoreData -Xlinker -dependency_info -Xlinker /Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/idaru_dependency_info.dat -o /Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Products/Debug-iphoneos/idaru.app/idaru

duplicate symbol _OBJC_IVAR_$_SettingsVC._reportProblemRow in:
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/SettingsVC.o
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/IDSettings.o
duplicate symbol _OBJC_IVAR_$_SettingsVC._profilePic in:
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/SettingsVC.o
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/IDSettings.o
duplicate symbol _OBJC_IVAR_$_SettingsVC._pushNotification in:
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/SettingsVC.o
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/IDSettings.o
duplicate symbol _OBJC_IVAR_$_SettingsVC._emailNotification in:
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/SettingsVC.o
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/IDSettings.o
duplicate symbol _OBJC_IVAR_$_SettingsVC._pushChanged in:
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/SettingsVC.o
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/IDSettings.o
duplicate symbol _OBJC_IVAR_$_SettingsVC._emailNotificationChanged in:
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/SettingsVC.o
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/IDSettings.o
duplicate symbol _OBJC_IVAR_$_SettingsVC._demo in:
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/SettingsVC.o
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/IDSettings.o
duplicate symbol _OBJC_IVAR_$_SettingsVC._managedObjectContext in:
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/SettingsVC.o
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/IDSettings.o
duplicate symbol _OBJC_CLASS_$_SettingsVC in:
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/SettingsVC.o
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/IDSettings.o
duplicate symbol _OBJC_METACLASS_$_SettingsVC in:
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/SettingsVC.o
/Users/M/Library/Developer/Xcode/DerivedData/idaru-bwkkgfbrgtgsmffxqcifyjsoehdq/Build/Intermediates/idaru.build/Debug-iphoneos/idaru.build/Objects-normal/armv7/IDSettings.o
ld: 10 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

这对我来说是新的,我不知道该怎么做。我从 textEdit 复制的文件的名称是 SettingsVC。项目中还有另一个名为 IDSettings 的文件,它执行不同的操作,但是,我没有对此执行任何操作。

导航器 Pane 中没有红色图像文件。然而,xctest 文件是红色的,尽管我读过这并不罕见。

非常感谢有关如何解决此问题的任何建议。

最佳答案

错误报告清楚地表明在文件SettingsVCIDSettings 中有很多重复的声明。

⇧⌘F 并键入例如 reportProblemRow 以查找重复项并删除或注释掉其中一个。

以同样的方式删除或注释掉所有其他重复项。

关于ios/objective-C : error: linker command failed with exit code 1 (use -v to see invocation),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34372091/

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