I've come across an error in a project in Xcode. I've been making good progress, and everything has been working reasonably well up until now. After making a few subtle layout changes to one of the pages in my app, when trying to run it - I get a mach-o linker error stating multiple (266!) duplicate symbols.
So far, I have:
I've looked at a number of similar posts, on this and other sites, and by far the majority of errors seem to be when people import a implementation file. When I've had similar errors in the past, they've been fairly easy to solve with going through the code - usually it's been duplicated variables in differing classes. This time, I've done my best to encapsulate things as well as possible, and I haven't had this issue on this project so far.
I'll post the error message here for now. The code is now posted on GitHub at https://github.com/bentaylor42/iRSI, as it's too long to fit on this page.
Ld /Users/bentaylor/Library/Developer/Xcode/DerivedData/irsi-acrjzbjeyiktwpglrdrfvwhlnhql/Build/Products/Debug-iphonesimulator/irsi.app/irsi normal i386
cd "/Users/bentaylor/Dropbox/iRSI v2/irsi"
export IPHONEOS_DEPLOYMENT_TARGET=7.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 i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk -L/Users/bentaylor/Library/Developer/Xcode/DerivedData/irsi-acrjzbjeyiktwpglrdrfvwhlnhql/Build/Products/Debug-iphonesimulator -F/Users/bentaylor/Library/Developer/Xcode/DerivedData/irsi-acrjzbjeyiktwpglrdrfvwhlnhql/Build/Products/Debug-iphonesimulator -filelist /Users/bentaylor/Library/Developer/Xcode/DerivedData/irsi-acrjzbjeyiktwpglrdrfvwhlnhql/Build/Intermediates/irsi.build/Debug-iphonesimulator/irsi.build/Objects-normal/i386/irsi.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -framework AudioToolbox -framework AVFoundation -framework QuartzCore -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/bentaylor/Library/Developer/Xcode/DerivedData/irsi-acrjzbjeyiktwpglrdrfvwhlnhql/Build/Intermediates/irsi.build/Debug-iphonesimulator/irsi.build/Objects-normal/i386/irsi_dependency_info.dat -o /Users/bentaylor/Library/Developer/Xcode/DerivedData/irsi-acrjzbjeyiktwpglrdrfvwhlnhql/Build/Products/Debug-iphonesimulator/irsi.app/irsi
duplicate symbol _OBJC_IVAR_$_MainMenuViewController._labelVersion in:
/Users/bentaylor/Library/Developer/Xcode/DerivedData/irsi-acrjzbjeyiktwpglrdrfvwhlnhql/Build/Intermediates/irsi.build/Debug-iphonesimulator/irsi.build/Objects-normal/i386/MainMenuViewController-9C9455DB49A1DC98.o
duplicate symbol _OBJC_IVAR_$_MainMenuViewController._labelCopyright in:
/Users/bentaylor/Library/Developer/Xcode/DerivedData/irsi-acrjzbjeyiktwpglrdrfvwhlnhql/Build/Intermediates/irsi.build/Debug-iphonesimulator/irsi.build/Objects-normal/i386/MainMenuViewController-9C9455DB49A1DC98.o
duplicate symbol _OBJC_IVAR_$_MainMenuViewController._switchPHEM in:
/Users/bentaylor/Library/Developer/Xcode/DerivedData/irsi-acrjzbjeyiktwpglrdrfvwhlnhql/Build/Intermediates/irsi.build/Debug-iphonesimulator/irsi.build/Objects-normal/i386/MainMenuViewController-9C9455DB49A1DC98.o
duplicate symbol _OBJC_IVAR_$_MainMenuViewController._labelPHEM in:
/Users/bentaylor/Library/Developer/Xcode/DerivedData/irsi-acrjzbjeyiktwpglrdrfvwhlnhql/Build/Intermediates/irsi.build/Debug-iphonesimulator/irsi.build/Objects-normal/i386/MainMenuViewController-9C9455DB49A1DC98.o
//... and so on, for 266 duplicated symbols, across multiple classes throughout the app)
ld: 266 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
You have many duplicate .m files in Compile Sources, remove them from your target named "irsi", after that, you should compile successfully.
Btw I think you also should remove the duplicate references from your projects, I have listed some of them in the picture below.