I’m facing an issue where XCode’s linker finds a duplicate symbol when compiling to iOS.
Linker output below:
duplicate symbol __ZN7cocos2d10Controller15s_allControllerE in:
/Users/anderson/Library/Developer/Xcode/DerivedData/cupcakechef-cwqasmdnejxcksgintanrezujimo/Build/Products/Debug-iphonesimulator/libcocos2dx iOS.a(CCController-iOS.o)
/Users/anderson/Library/Developer/Xcode/DerivedData/cupcakechef-cwqasmdnejxcksgintanrezujimo/Build/Products/Debug-iphonesimulator/libcocos2dx iOS.a(CCController.o)
ld: 1 duplicate symbol for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
So far as I understand it, I’m trying to link CCController as well as CCController-iOS on the same project, and it seems to me they have definitions for the exact same classes/methods (which kinda makes sense, as one of them is the interface and the other is the actual implementation)… so how is it that they would conflict?
I’m totally lost on this one… any tips?
[EDIT]
After further research I found out that using -ObjC on other linker flags (required by the AdMob SDK) will lead to that error on Simulator builds. Runs fine on the device though.
I’m fine with AdMob only working on the device, but that would be nice if I was able to test it on the simulator as well… so if anyone can help, that would be much appreciated!
I have the same problem here, unfortunately I need the simulator because I do not have an iOS device …
Any help?
When I remove the GameController.framework from Build Phases / Link Binary With Libraries
this error appears:
Undefined symbols for architecture i386:
"_GCControllerDidConnectNotification", referenced from:
-[GCControllerConnectionEventHandler observerConnection:disconnection:] in libcocos2dx iOS.a(CCController-iOS.o)
"_GCControllerDidDisconnectNotification", referenced from:
-[GCControllerConnectionEventHandler observerConnection:disconnection:] in libcocos2dx iOS.a(CCController-iOS.o)
"_OBJC_CLASS_$_GCController", referenced from:
objc-class-ref in libcocos2dx iOS.a(CCController-iOS.o)
(maybe you meant: _OBJC_CLASS_$_GCControllerConnectionEventHandler)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
When I add the GameController.framework in Build Phases / Link Binary With Libraries
this error appears:
duplicate symbol __ZN7cocos2d10Controller15s_allControllerE in:
/Users/Jonathan/Library/Developer/Xcode/DerivedData/SpeedyJump-bdkxxynxsbevtddejoudhajmhvby/Build/Products/Debug-iphonesimulator/libcocos2dx iOS.a(CCController-iOS.o)
/Users/Jonathan/Library/Developer/Xcode/DerivedData/SpeedyJump-bdkxxynxsbevtddejoudhajmhvby/Build/Products/Debug-iphonesimulator/libcocos2dx iOS.a(CCController.o)
ld: 1 duplicate symbol for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The project is created in cocos2dx v3.2. I just add Admob code in Appcontroller.h and AppController.mm. When I was trying to test the application by simulator (iPhone Retina 4-inch), the problem appear. But When I test with a real iPhone5s, there is no problem. What is your solution from v3.2RC to v3.2? Can you send me the fix? Thanks.
Sorry, it’s my mistake. I created the project in cocos2dx 3.2 RC0. Now I copied the cocos2d folder of 3.2 version to my project folder. the problem is solved. Thank you.
Error loading /System/Library/Extensions/IOHIDFamily.kext/ …
I get the same errors as this. That shows up in the simulator, not on the device. Did you end up figuring anything out ?
Hello, I am reviving this topic because when a similar problem when I tried to integrate Google Play Game Services SDK, see the error:
duplicate symbol _OPENSSL_cleanse in:
/Volumes/01-Projetos/Cocos2d-x3.2rc0/00-Libs/Google Play/gpg.framework/gpg(libgpg.a-i386-master.o)
/Users/Jonathan/Library/Developer/Xcode/DerivedData/Ghost_Run-cijyahoyskjltzbmaarynylpkymr/Build/Products/Debug-iphonesimulator/libcocos2dx iOS.a(x86cpuid.o)
ld: 1 duplicate symbol for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)