gpt4 book ai didi

ios - 链接器失败,错误代码为 1

转载 作者:行者123 更新时间:2023-11-28 22:13:42 24 4
gpt4 key购买 nike

我一直收到错误 Linker command failed with exit code 1 这似乎是因为我的 .h-file。在我的 stringsDE.h 中,我定义了常量字符串。这可能是问题所在吗?

duplicate symbol _QUESTIONCATBUTTONMIXED in: /Users/philip_air/Library/Developer/Xcode/DerivedData/juraQuiz-awgytksreajdjbdmoctjoffmzmmk/Build/Intermediates/juraQuiz.build/Debug-iphoneos/juraQuiz.build/Objects-normal/armv7/appLaunch.o /Users/philip_air/Library/Developer/Xcode/DerivedData/juraQuiz-awgytksreajdjbdmoctjoffmzmmk/Build/Intermediates/juraQuiz.build/Debug-iphoneos/juraQuiz.build/Objects-normal/armv7/quizVC.o ld: 17 duplicate symbols for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

代码:

http://pastebin.com/iGTVAb6K

最佳答案

使用以下方法在 .h 文件中声明所有字符串:

// QUESTIONCAT BUTTONS
extern NSString const *QUESTIONCATBUTTON1;
extern NSString const *QUESTIONCATBUTTON2;
extern NSString const *QUESTIONCATBUTTON3;
extern NSString const *QUESTIONCATBUTTONMIXED;

然后像这样在一个单独的 .m 文件中真正定义它们:

// QUESTIONCAT BUTTONS
NSString * const QUESTIONCATBUTTON1 = @"Zivilrecht";
NSString * const QUESTIONCATBUTTON2 = @"öffentliches Recht";
NSString * const QUESTIONCATBUTTON3 = @"Strafrecht";
NSString * const QUESTIONCATBUTTONMIXED = @"Gemischt";

关于ios - 链接器失败,错误代码为 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22290512/

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