The Problem
Xcode (Version 4.6.1 (4H512)) is complaining a duplicate symbole problem.
duplicate symbol _OBJC_METACLASS_$_PacksStoreHelper in:
/Users/shannoga/Library/Developer/Xcode/DerivedData/English_Club-cyrjamihpabtvtdkvctjwyidupuo/Build/Intermediates/English Club.build/Debug-iphonesimulator/English Club.build/Objects-normal/i386/PacksStoreViewController.o
/Users/shannoga/Library/Developer/Xcode/DerivedData/English_Club-cyrjamihpabtvtdkvctjwyidupuo/Build/Intermediates/English Club.build/Debug-iphonesimulator/English Club.build/Objects-normal/i386/PacksStoreHelper.o
duplicate symbol _OBJC_CLASS_$_PacksStoreHelper in:
/Users/shannoga/Library/Developer/Xcode/DerivedData/English_Club-cyrjamihpabtvtdkvctjwyidupuo/Build/Intermediates/English Club.build/Debug-iphonesimulator/English Club.build/Objects-normal/i386/PacksStoreViewController.o
/Users/shannoga/Library/Developer/Xcode/DerivedData/English_Club-cyrjamihpabtvtdkvctjwyidupuo/Build/Intermediates/English Club.build/Debug-iphonesimulator/English Club.build/Objects-normal/i386/PacksStoreHelper.o
ld: 2 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Usually I go to the Target Build Pases -> Compile Sources and look for the duplicate.
This time as you can see there is no duplication there:
What I tried and some wacky stuff :
Deleting Derived Data.
Removing the project and restarted the mac.
I even tried to delete the so called "duplicate" files and here it got even more wacky - The target successfully builded and there was no warning even that the files were not visible in the file navigator. After the build the app works fine but one of the controllers is not visible.
I Alt+Clicked the import statements of the duplicate files in other files that uses them and it gets me onto a "Zombie" file with all the code inside. But I can not see where xCode get the file from.
What the hell could it be?
I am about to shoot myself. Please save me.
Related
I got this error after reimporting the soomla package.
How to solve this?
duplicate symbol _NewBase64Encode_soomla in:
/Users/Nikunj/Unity/2D/NoOneCanDoIt/Build/b2/Libraries/Plugins/iOS/Soomla/libSoomlaiOSCore.a(NSData-Base64.o)
/Users/Nikunj/Unity/2D/NoOneCanDoIt/Build/b2/Libraries/Plugins/iOS/SoomlaShared/libKeeva.a(NSData-Base64.o)
duplicate symbol _NewBase64Decode_soomla in:
/Users/Nikunj/Unity/2D/NoOneCanDoIt/Build/b2/Libraries/Plugins/iOS/Soomla/libSoomlaiOSCore.a(NSData-Base64.o)
/Users/Nikunj/Unity/2D/NoOneCanDoIt/Build/b2/Libraries/Plugins/iOS/SoomlaShared/libKeeva.a(NSData-Base64.o)
duplicate symbol _OBJC_CLASS_$_FBEncryptorAES in:
/Users/Nikunj/Unity/2D/NoOneCanDoIt/Build/b2/Libraries/Plugins/iOS/Soomla/libSoomlaiOSCore.a(FBEncryptorAES.o)
/Users/Nikunj/Unity/2D/NoOneCanDoIt/Build/b2/Libraries/Plugins/iOS/SoomlaShared/libKeeva.a(FBEncryptorAES.o)
duplicate symbol _OBJC_METACLASS_$_FBEncryptorAES in:
/Users/Nikunj/Unity/2D/NoOneCanDoIt/Build/b2/Libraries/Plugins/iOS/Soomla/libSoomlaiOSCore.a(FBEncryptorAES.o)
/Users/Nikunj/Unity/2D/NoOneCanDoIt/Build/b2/Libraries/Plugins/iOS/SoomlaShared/libKeeva.a(FBEncryptorAES.o)
ld: 4 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Showing first 200 warnings only
Unfortunately libKeeva and libSoomlaiOSCore contain the same functions and classes (symbols). You need to exclude one of these libraries or rebuilt one of them not using conflicting symbols (or make it depend on another library).
Another variant is to include one of the libraries to your project as source code.
UPD: it seems like libSoomlaiOSCore and libKeeva is simply two versions of Soomla, so you can just delete one of them.
I am working on building a Swift library and am hosting it on GitHub.
All was going fine until I added BluetoothKit to the project. I then got an Apple Mach-O Linker Error:
ld: warning: directory not found for option '-F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/Developer/Library/Frameworks'
ld: /Users/calebklevetertest/Library/Developer/Xcode/DerivedData/Napalm-dblvhbjdwovurocsvzrzaxzkjjyw/Build/Products/Debug-iphonesimulator/Napalm.framework/Napalm compiled with older version of Swift language (2.0) than previous files (3.0) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
From reading the error it appears the issue somehow stems from the fact I am using Swift 3, but I can't figure out how to fix it.
I did convert BluetoothKit to Swift 3 when I added it.
There is one class that uses BluetoothKit and it is called NPFBluetooth.
A couple things to note are 1) Even though the class is public, the compiler gives an error of 'unresolved identifier', 2) The class does not show in the auto-complete and 3) All the other classes work fine.
I ran into the error migrating to swift3. As it turns out Xcode keeps copies of built frameworks and moving to swift3 is apparently not a cue to rebuild those (even after finding out it was built using swift2.... no let's throw a vague error instead...)
The solution is to delete the content of your 'derived data' folder.
Works for frameworks installed with Carthage and cocoapods.....
Go to your build settings and switch the target's settings to ENABLE_BITCODE = YES for now.
It's working for me ;)
Yesterday i integrated Google's Admobs fine into my Xcode 6.1 project. Everything worked. Today i open Xcode and i receive the following errors...
ld: warning: directory not found for option '-L/Users/Marco/Desktop/SpaceAlien copy 1/Space
ld: warning: directory not found for option '-LAlien'
ld: library not found for -lGoogleAdMobAds
It's 2 yellow warning errors and the RED error doesn't let me build project = GoogleAdMobAds
So I read in Project Navigator for libGoogleAdMobAds.a in target membership to unclick and then click back the check. That works and project builds. However, when i close project open it again, I get the same error. How do I make this error remove permanently? Also, for the ld: warning: directory not found errors I went to build setting then library search paths and i CAN'T delete anything, don't know what to do. Please HELP!
ld: warning: directory not found for option '-L/Users/Marco/Desktop/SpaceAlien copy 1/Space
Problem is because the path contains spaces. Try using quotes with the path: "Users/Marco/Desktop/SpaceAlien copy 1/Space"
or you can use escape "\" character to "fix" the path:
Users/Marco/Desktop/SpaceAlien\ copy\ 1/Space
I am encountering 'duplicate symbol' errors in Xcode 4.5.1 when I try to build a project after adding my own framework. I verified the framework files for duplicates and there are none. But when I add the framework to a project, it complains with these error. Please suggest..
duplicate symbol _NXArgc in:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib/crt1.3.1.o
/Users/idcc/Test/MyFW/Products/MyTestFW.framework/MyTestFW
duplicate symbol _NXArgv in:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib/crt1.3.1.o
/Users/idcc/Test/MyFW/Products/MyTestFW.framework/MyTestFW
duplicate symbol ___progname in:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib/crt1.3.1.o
/Users/idcc/Test/MyFW/Products/MyTestFW.framework/MyTestFW
duplicate symbol _environ in:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib/crt1.3.1.o
/Users/idcc/Test/MyFW/Products/MyTestFW.framework/MyTestFW
duplicate symbol start in:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib/crt1.3.1.o
/Users/idcc/Test/MyFW/Products/MyTestFW.framework/MyTestFW
ld: 8 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thanks in advance..
I had the same issue with using two third party framework. I resolved that by removing "all_load" from "Other Linker Flags" in build settings.
Those symbols are in crt.o, the startup code of standard C library. Normally it should be the entry point of executable file to initialize global variables and objects. It will also call your main function.
But for a framework, you should not include it in your binary because framework should not have main.
I believe you have "Link with Standard Library" option as "YES" in your framework's target build setting. This will link crt.o into your framework. And when you link the framework into a project, there will be duplicated symbols.
Please set the option "Link with Standard Library" to NO in your build setting.
Your application has provided an implementation in which there are 8 duplication symbols.
There are a number of ways you might have done this:
You have two modules declaring the same class. Perhaps one is no longer needed?
You are importing any header file in both the files .m and .h :-( Remove from one place.)
You are importing any .m file somewhere. :- (Import .h file instead of .m file)
You have defined and declared any const variable in outside(above) the #interface{} in any of .h file, it might being duplicated. :- (Do it in the .m file.)
Also check, if global variables like constants are defined correctly in .h file in application.
The correct way of defining global variable is to use extern variable in .h file.
Note :This is not an issue with the previous Xcode version. I faced the problem with Xcode 6.3 and it was solved.
If you have this problem only when you run the app in the simulator, it gets solved by deleting the local folder
~/Library/Developer/CoreSimulator
Xcode will restore it after the first build and run.
PLEASE MAKE SURE YOU BACKUP ANY SETTINGS before doing this (especially those related to simulator devices).
Tested on Xcode Version 7.2.1 (7C1002)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_AppDelegate_Shared", referenced from:
_OBJC_CLASS_$_AppDelegate_iPad in AppDelegate_iPad.o
"_OBJC_METACLASS_$_AppDelegate_Shared", referenced from:
_OBJC_METACLASS_$_AppDelegate_iPad in AppDelegate_iPad.o ld: symbol(s) not found for architecture i386 clang: error: linker command
failed with exit code 1 (use -v to see invocation)
Hello, this is a straight up AppDelegate, and I'm getting this error. Any ideas? There's no library to link to or anything. I've seen these errors time and time again in XCode, but the causes have ranged from a libxml2 library being not right (needed libxml2.7.3), to just something odd in XCode itself. No idea what to do next, but obviously would like the program to compile. Thanks!
same here. thanks for the answer.
I had just (literally 30 seconds ago) dragged the files in.
I used the same files in other projects no problem.
got this linker error (updated to XCode 4.3 yesterday)
and same problem, the .m file was checked for the Test target membership, but NOT the app target.
possibly a 4.3 bug. it seems it is defaulting to adding dragged in files to the test build and not the app build.
thanks... you helped me find it very fast. I was not looking forward to that.