我一直收到错误Linker command failed with exit code 1
,这似乎是因为我的.h-file
。在我的stringsDE.h
中,我定义了常量字符串。这可能是问题吗?
重复符号_QUESTIONCATBUTTONMIXED: /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:架构armv7的17个重复符号 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
CODE:
答案 0 :(得分:2)
使用以下命令在.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";
答案 1 :(得分:0)
我之前已经知道了#importing .m文件而不是.h。