Duplicate Symbols causing Apple Mach-O Linker Error - ios

I am receiving the following error when building my project.
duplicate symbol _OBJC_CLASS_$_PrintAdventureMenuViewController in:
/Users/ethanraymond/Library/Developer/Xcode/DerivedData/jake-and-bailey-fbutnsfforlfnpgkxyojdsdcaobc/Build/Intermediates/jake-and-bailey.build/Debug-iphonesimulator/jake-and-bailey.build/Objects-normal/i386/PrintAdventureMenuViewController.o
/Users/ethanraymond/Library/Developer/Xcode/DerivedData/jake-and-bailey-fbutnsfforlfnpgkxyojdsdcaobc/Build/Intermediates/jake-and-bailey.build/Debug-iphonesimulator/jake-and-bailey.build/Objects-normal/i386/AdventureTypeMenuViewController.o
duplicate symbol _OBJC_METACLASS_$_PrintAdventureMenuViewController in:
/Users/ethanraymond/Library/Developer/Xcode/DerivedData/jake-and-bailey-fbutnsfforlfnpgkxyojdsdcaobc/Build/Intermediates/jake-and-bailey.build/Debug-iphonesimulator/jake-and-bailey.build/Objects-normal/i386/PrintAdventureMenuViewController.o
/Users/ethanraymond/Library/Developer/Xcode/DerivedData/jake-and-bailey-fbutnsfforlfnpgkxyojdsdcaobc/Build/Intermediates/jake-and-bailey.build/Debug-iphonesimulator/jake-and-bailey.build/Objects-normal/i386/AdventureTypeMenuViewController.o
ld: 2 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This was just after creating "PrintAdventureMenuViewController" class. So it is currently empty. "AdventureTypeMenuViewController" is not empty. It is populated with views other code.

My problem was that in the AdventureTypeMenuViewController.m file I used the import statement...
#import "PrintAdventureMenuViewController.m"
rather than...
#import "PrintAdventureMenuViewController.h"

Related

linker command failed: duplicate symbol for architecture arm64

I am having this error while running my project. I referred so many answers and did the same but can't resolve this issue.
duplicate symbol _kReachabilityChangedNotification in:
/Users/admin/Downloads/workRepo/SafetraxApp/MAppIOS/build2/Safetrax/Build/Intermediates/Safetrax.build/Debug-iphoneos/Parent App.build/Objects-normal/arm64/Reachability.o
Pods/catapush-ios-sdk-pod/CatapushKit/libCatapushLib.a(CLIntReachability.o)
ld: 1 duplicate symbol for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I assume you are using the Reachability snippet from Apple. Unfortunately, that piece of code and the accompanying constants are being used in several Cocoapods. That's what causes this error. It basically means that the symbol/constant kReachabilityChangedNotification has been defined twice in your binary: once in your Application and once in the CatapushKit pod.
The easiest way to fix is: Rename the constant in your code. The other option would be to delete the Reachbility code from your app and use the CLIntReachability implementation from CatapushKit.

clang: error: linker command failed: duplicate symbols for architecture x86_64

In my app i am getting this error:
linker command failed with exit code 1
/Users/mac/Library/Developer/Xcode/DerivedData/BalirajaTractor-cfrcwepounrfzmcqcpnfxpsftfdg/Build/Intermediates/BalirajaTractor.build/Debug-iphonesimulator/BalirajaTractor.build/Objects-normal/x86_64/MenuViewController.o
duplicate symbol _areaArray in:
/Users/mac/Library/Developer/Xcode/DerivedData/BalirajaTractor-cfrcwepounrfzmcqcpnfxpsftfdg/Build/Intermediates/BalirajaTractor.build/Debug-iphonesimulator/BalirajaTractor.build/Objects-normal/x86_64/AddProductViewController.o
/Users/mac/Library/Developer/Xcode/DerivedData/BalirajaTractor-cfrcwepounrfzmcqcpnfxpsftfdg/Build/Intermediates/BalirajaTractor.build/Debug-iphonesimulator/BalirajaTractor.build/Objects-normal/x86_64/MenuViewController.o
ld: 8 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I had encountered a similar error recently because I had #import class.m instead of #import class.h. Check whether you have made that mistake.
Facing the same problem with Xcode 8.1.When I use NSManagedObject Subclass to create entities. I got 4 files Entity+CoreDataClass.h, Entity+CoreDataClass.m, EntityCoreDataProperties.h, Entity+COreDataProperties.m.
When I run the code , I got the error.
When I delete the Entity+CoreDataClass.m in Targets>>Build Phases>>Complies Sources, the error is gone.
Really hope can help someone.

Admob causing Apple Mach-O Linker Error when trying to archive project

When project is working fine when I try to run in simulator. However, when I try to archive the project, I got the follow error. The code is too long. I just putting some part of it.
duplicate symbol l017 in:
GoogleMobileAds.framework/GoogleMobileAds(GADBannerAdViewDelegate.o)
GoogleMobileAds(GADRewardBasedVideoAd+Mediation.o)
duplicate symbol l018 in:
GoogleMobileAds.framework/GoogleMobileAds(GADCSITimeRecorder.o)
GoogleMobileAds.framework/GoogleMobileAds(GADRewardBasedVideoAd+Mediation.o)
duplicate symbol l008 in:
GoogleMobileAds.framework/GoogleMobileAds(GADNativeAdAttributionView.o)
GoogleMobileAds.framework/GoogleMobileAds(GADPushTransitionView.o)
duplicate symbol l014 in:
GoogleMobileAds.framework/GoogleMobileAds(GADPinger.o)
GoogleMobileAds.framework/GoogleMobileAds(GADAdAppViewController.o)
ld: 28 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How to solve this?
Problem solved by removing the "-ObjC" linker flag.

linker command failed with exit code 1 (use -v to see invocation

I am getting the following linking error in Xcode 6. Any ideas how to solve this
duplicate symbol _OBJC_IVAR_$_SCClip._m4g1c in:
/Users/Abdul/Library/Developer/Xcode/DerivedData/SoundCandy-bwekfiwyyjgmwhbgztfrqedobxxn/Build/Intermediates/SoundCandy.build/Debug-iphonesimulator/SoundCandyTests.build/Objects-normal/x86_64/SCClip-F338C753334EE43A.o
duplicate symbol _SCCLIP_INPUT_TOKEN in:
/Users/Abdul/Library/Developer/Xcode/DerivedData/SoundCandy-bwekfiwyyjgmwhbgztfrqedobxxn/Build/Intermediates/SoundCandy.build/Debug-iphonesimulator/SoundCandyTests.build/Objects-normal/x86_64/SCClip-F338C753334EE43A.o
duplicate symbol _OBJC_CLASS_$_SCClip in:
/Users/Abdul/Library/Developer/Xcode/DerivedData/SoundCandy-bwekfiwyyjgmwhbgztfrqedobxxn/Build/Intermediates/SoundCandy.build/Debug-iphonesimulator/SoundCandyTests.build/Objects-normal/x86_64/SCClip-F338C753334EE43A.o
duplicate symbol _OBJC_METACLASS_$_SCClip in:
/Users/Abdul/Library/Developer/Xcode/DerivedData/SoundCandy-bwekfiwyyjgmwhbgztfrqedobxxn/Build/Intermediates/SoundCandy.build/Debug-iphonesimulator/SoundCandyTests.build/Objects-normal/x86_64/SCClip-F338C753334EE43A.o
ld: 4 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I fixed by selecting and deselecting target membership of the problematic file in the file inspector in Xcode

Linker Command Failed

duplicate symbol __Z13createDustVFXPN7cocos2d6CCNodeEff in:
/Users/SrinivasJ/Library/Developer/Xcode/DerivedData/Race-fahplwvpmjymyegjbzoghrjofgou/Build/Intermediates/Race.build/Debug-iphonesimulator/Race.build/Objects-normal/i386/AIBike.o
/Users/SrinivasJ/Library/Developer/Xcode/DerivedData/Race-fahplwvpmjymyegjbzoghrjofgou/Build/Intermediates/Race.build/Debug-iphonesimulator/Race.build/Objects-normal/i386/Bike.o
ld: 1 duplicate symbol for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
above error i got. i find the duplicate method in both class "createDustVFX"
and i changed method name. its working fine.
but want to know why its given duplicate symbol error.
both class are in different folder. no connection with each Classes.

Resources