9

I know this Question has been asked many times before, but none has solved my problem uptill now. I know that this error occurs when you got multiple copies of your file in project. I tried to clean the build, delete any LoginController.m file in Compile Sources and then build. Fine - no errors. When I added my LoginController.m file in Complie resources, compiler again gave the same error.

Next I what I tried is delete all .m files from Compile Sources, clean and rebuild successfully, and added each .m file very carefully. Again same error has been raised. I did not find any duplicate file, then why the heck is this happening?

Please someone guide me. Thanks alot.

EDIT: Error is:

Ld /Users/svp/Library/Developer/Xcode/DerivedData/TryAgain-dhbbyywxclvxfodbunqysmmfefcl/Build/Products/Debug-iphonesimulator/TryAgain.app/TryAgain normal i386 cd /Users/svp/Desktop/TryAgain setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/svp/Library/Developer/Xcode/DerivedData/TryAgain-dhbbyywxclvxfodbunqysmmfefcl/Build/Products/Debug-iphonesimulator -L/Users/svp/Desktop/TryAgain/TryAgain -L/Users/svp/Desktop/TryAgain/../CorePlot_1.0/Binaries/iOS -F/Users/svp/Library/Developer/Xcode/DerivedData/TryAgain-dhbbyywxclvxfodbunqysmmfefcl/Build/Products/Debug-iphonesimulator -filelist /Users/svp/Library/Developer/Xcode/DerivedData/TryAgain-dhbbyywxclvxfodbunqysmmfefcl/Build/Intermediates/TryAgain.build/Debug-iphonesimulator/TryAgain.build/Objects-normal/i386/TryAgain.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -all_load -fobjc-arc -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework MediaPlayer -lz -framework AVFoundation -framework MobileCoreServices -framework SystemConfiguration -framework CFNetwork -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -lCorePlot-CocoaTouch -o /Users/svp/Library/Developer/Xcode/DerivedData/TryAgain-dhbbyywxclvxfodbunqysmmfefcl/Build/Products/Debug-iphonesimulator/TryAgain.app/TryAgain

ld: duplicate symbol _OBJC_CLASS_$_LoginController in /Users/svp/Library/Developer/Xcode/DerivedData/TryAgain-dhbbyywxclvxfodbunqysmmfefcl/Build/Intermediates/TryAgain.build/Debug-iphonesimulator/TryAgain.build/Objects-normal/i386/LoginController.o and /Users/svp/Library/Developer/Xcode/DerivedData/TryAgain-dhbbyywxclvxfodbunqysmmfefcl/Build/Intermediates/TryAgain.build/Debug-iphonesimulator/TryAgain.build/Objects-normal/i386/Navigator.o for architecture i386 Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1

NightFury
  • 13,436
  • 6
  • 71
  • 120

1 Answers1

24

Your error message says that the binaries created from both LoginController.m and Navigator.m define an implementation for your LoginController class. It sometimes happens that this is because of a shared header file that contains implementation logic. Check your Navigator.h/.m for references to a LoginController.

Phillip Mills
  • 30,888
  • 4
  • 42
  • 57
  • 5
    Oh my God. Philips you really pointed out at the mistake. You are right. I declared "LoginController.m" instead of "LoginController.h" in a file - damn me. You really saved my time. You also helped me before. You rocks!! Thanks :D – NightFury Nov 24 '12 at 15:02
  • You're welcome. The "trick" in this case is to really focus on what the error message is trying to say. That is, the symbol was found in both "LoginController.o" and "Navigator.o". One of those is obviously expected but the other isn't. – Phillip Mills Nov 24 '12 at 15:08
  • This type of error is really hard to understand for beginners like me. Thanks for elaborating. – NightFury Nov 24 '12 at 15:17
  • thnx you saved my day :) – Devarshi Jan 18 '14 at 04:52