Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgraded to Xcode 4 -- Endless stream of duplicate symbol errors causing build errors

Everything was working perfectly fine in Xcode 3 yesterday before I upgraded. So I completed the upgrade, restarted my computer, and opened my old project. I had to reconfigure a few settings like the header paths so that I could begin to compile. I'm using AdWhirl for ad mediation, and at this point my errors begin to read something like

   duplicate symbol _OBJC_METACLASS_$_SBJSON in /Users/Admin/Desktop/TMapLiteAdwhirl/AdWhirl/MMSDK/libMMSDK.a(SBJSON.o) and 
/Users/Admin/Library/Developer/Xcode/DerivedData/TruxMapLite-bgpylibztethnlhkfkdumpvrjvgy/Build/Intermediates/TruxMapLite.build/Debug-iphoneos/TruxMapLite.build/Objects-normal/armv6/SBJSON.o for architecture armv6

The library it's referring to is the SDK for one of the ad networks I'm including in AdWhirl. Both of the 'duplicate symbols' refer to the SAME FILE, but they use different paths. If I had still had XCode 3, I would simply try excluding these libraries from the build path, but I have no idea how that can be done in Xcode 4. I've tried everything all the way down to deleting the library and all associated files from my project, but when I do this, i will simply get the same type of error for a different library in the AdWhirl directory.

This is incredibly frustrating because before my upgrade everything was working smoothly and I was prepared to submit my binary. If anyone has any advice, id be more than happy to give it a try. Thanks!

like image 908
D-Nice Avatar asked Mar 13 '11 19:03

D-Nice


2 Answers

I just ran into a similar problem and resolved it by editing my build settings:

  1. Choose the Project Navigator from the navigator list at left (⌘-1).
  2. Select your project file.
  3. Select your the target from the list that appears in the editor area.
  4. Switch to the Build Phases tab.
  5. Check Link Binary with Libraries and/or Compile Sources for the duplicated library.

Now, I am not using the same library or project configuration, so this may be way off-base.

like image 184
Justin Avatar answered Nov 13 '22 06:11

Justin


Make sure that you're not importing .m files.

This mistake caused endless problems for me.

like image 29
Pada Avatar answered Nov 13 '22 06:11

Pada