I'm trying to create a project utilizing both MailChimp and ShareKit code.
I believe I'm dynamically linking to them both by dragging their Xcode project files into my new project, then dragging and dropping the desired groups.
The problem I'm having now is that they both use a file name called SBJSonParser from their JSON libraries.
I'm getting an error that says:
ld: duplicate symbol _OBJC_CLASS_$_SBJsonParser
I don't want / don't think renaming the files would be sufficient, as there are quite a few more filenames they have in common. Does anyone have ideas on what to do? Thanks
Full error:
Ld /Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Products/Debug-iphonesimulator/PolaroidMe.app/PolaroidMe normal i386
cd /Users/user/Documents/PolaroidMe
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/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Products/Debug-iphonesimulator -F/Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Products/Debug-iphonesimulator -filelist /Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Intermediates/PolaroidMe.build/Debug-iphonesimulator/PolaroidMe.build/Objects-normal/i386/PolaroidMe.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework CoreLocation -framework Twitter -framework CFNetwork -framework SystemConfiguration -framework Security -framework MessageUI -framework AVFoundation -framework MobileCoreServices -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Products/Debug-iphonesimulator/PolaroidMe.app/PolaroidMe
ld: duplicate symbol _OBJC_CLASS_$_SBJsonParser in /Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Intermediates/PolaroidMe.build/Debug-iphonesimulator/PolaroidMe.build/Objects-normal/i386/SBJsonParser-7C0C46CE63D45CA3.o and /Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Intermediates/PolaroidMe.build/Debug-iphonesimulator/PolaroidMe.build/Objects-normal/i386/SBJsonParser-227BA1E6AFC01E91.o for architecture i386
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
ld: duplicate symbol _OBJC_CLASS_$_SBJsonParser in /Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Intermediates/PolaroidMe.build/Debug-iphonesimulator/PolaroidMe.build/Objects-normal/i386/SBJsonParser-7C0C46CE63D45CA3.o and /Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Intermediates/PolaroidMe.build/Debug-iphonesimulator/PolaroidMe.build/Objects-normal/i386/SBJsonParser-227BA1E6AFC01E91.o for architecture i386
SBJSON is a library, it only needs to be inside your project once. Just delete one of them.
Related
Full error message:
Ld/Users/chairman/Library/Developer/Xcode/DerivedData/Field_Final-dsxytmugnwuntcglfimizlbtmegi/Build/Products/Debug-iphonesimulator/Field_Final.app/Field_Final normal i386
cd "/Users/chairman/Documents/Vitthal/NEWFSNOV21_2.3/FSDEVICE2.3 dec6/Field_Final"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Users/chairman/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Users/chairman/Desktop/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Users/chairman/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Users/chairman/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/chairman/Library/Developer/Xcode/DerivedData/Field_Final-dsxytmugnwuntcglfimizlbtmegi/Build/Products/Debug-iphonesimulator -F/Users/chairman/Library/Developer/Xcode/DerivedData/Field_Final-dsxytmugnwuntcglfimizlbtmegi/Build/Products/Debug-iphonesimulator -filelist /Users/chairman/Library/Developer/Xcode/DerivedData/Field_Final-dsxytmugnwuntcglfimizlbtmegi/Build/Intermediates/Field_Final.build/Debug-iphonesimulator/Field_Final.build/Objects-normal/i386/Field_Final.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Objc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -framework MapKit -framework CoreLocation -lz.1.2.5 -lstdc++.6 -licucore.A -framework AddressBook -framework CoreFoundation -framework CFNetwork -framework Security -framework MobileCoreServices -framework SystemConfiguration -framework MessageUI -framework UIKit -framework Foundation -framework CoreGraphics -lAfariaSLL -lMAKit -lsupUltralite -lsupcore -lSUPObj -lclientrt -lDatavault -lMO -o /Users/chairman/Library/Developer/Xcode/DerivedData/Field_Final-dsxytmugnwuntcglfimizlbtmegi/Build/Products/Debug-iphonesimulator/Field_Final.app/Field_Final
ld: library not found for -lAfariaSLL
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Go to your target. Under build settings, search for "library search paths". There you should list all the directories where your linked libraries are located.
In respect to SUP, read here about the project settings: http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc01213.0225/doc/html/aro1369255660920.html. The link is for v2.2.5, you can select on the left your version and find the document there.
Try this :
Go to targets -> Build phases -> Link Binary With Libraries
Click on + symbol
Press Add Other & add your library
Clean project & than run
I don't understand my error:
Ld
Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/Test.app/Test
normal i386
cd /Users/lol/Desktop/Test
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/llvm-gcc-4.2
-arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
-L/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator
-L/Users/lol/Desktop/Test -F/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator
-filelist /Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Intermediates/Test.build/Debug-iphonesimulator/Test.build/Objects-normal/i386/Test.LinkFileList
-mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -lextThree20JSON+SBJSON /Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20UICommon.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20UINavigator.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20Core.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20UI.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20Network.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20Style.a
-framework SystemConfiguration -framework MobileCoreServices -framework CFNetwork -framework AddressBook -framework AddressBookUI -framework QuartzCore -framework UIKit -framework Foundation -framework MessageUI -framework CoreGraphics -lz.1.2.3 -lxml2.2.7.3 -o /Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/Test.app/Test
ld: library not found for -lz.1.2.3
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1
Can you help me to understand this?
Thanks a lot ;)
The option -lz.1.2.3 means that the compiler is attempting to link the file libz.1.2.3.a, libz.1.2.3.so, or libz.1.2.3.dylib. It cannot find any of these variations and is failing because of that.
You can attempt to find the location of this file and include it in your library include path.
My question is why are you linking a specific version of z lib? Usually, it's good enough to just have -lz or -llibz.dylib. Do you have a reason for picking a specific version? What happens when you link using the un-versioned name.
Just use -lz, there's no need to use the versioned link to it. So remove libz-1.2.3.tbd from frameworks and add libz.tbd.
In the project navigator, select your project.
Select your target.
Select the "Build Phases" tab.
Open "Link Binaries With Libraries" expander.
Remove libz-1.2.3.tbd
Click the + button.
Add libz.tbd
I have started adding core data to my application. I created the entity with name Assets and defined its four attributes and then created Asset.h and Asset.m file for NSManagedObject. Now I am getting the following error while before that my application was working fine
Ld /Users/Omer/Library/Developer/Xcode/DerivedData/LoginTest-enoqygjnncuapjescysdafbighag/Build/Products/Debug-iphonesimulator/LoginTest.app/LoginTest normal i386
cd /Users/Omer/Desktop/Docs/LoginTest
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/Omer/Library/Developer/Xcode/DerivedData/LoginTest-enoqygjnncuapjescysdafbighag/Build/Products/Debug-iphonesimulator -L/Users/Omer/Desktop/Docs/LoginTest/ZBarSDK -F/Users/Omer/Library/Developer/Xcode/DerivedData/LoginTest-enoqygjnncuapjescysdafbighag/Build/Products/Debug-iphonesimulator -filelist /Users/Omer/Library/Developer/Xcode/DerivedData/LoginTest-enoqygjnncuapjescysdafbighag/Build/Intermediates/LoginTest.build/Debug-iphonesimulator/LoginTest.build/Objects-normal/i386/LoginTest.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -liconv -framework QuartzCore -framework CoreVideo -framework CoreMedia -framework AVFoundation -framework MapKit -framework CoreLocation -lz -framework CoreGraphics -framework MobileCoreServices -framework SystemConfiguration -framework CFNetwork -framework Foundation -framework UIKit -lzbar -o /Users/Omer/Library/Developer/Xcode/DerivedData/LoginTest-enoqygjnncuapjescysdafbighag/Build/Products/Debug-iphonesimulator/LoginTest.app/LoginTest
Undefined symbols for architecture i386:
"_OBJC_METACLASS_$_NSManagedObject", referenced from:
_OBJC_METACLASS_$_Asset in Asset.o
"_OBJC_CLASS_$_NSManagedObject", referenced from:
_OBJC_CLASS_$_Asset in Asset.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please include coreData framework ...
I wouldn't create these classes myself. I"d recommend you to delete them and use mogenerator to do it for you. It will create 4 classes for each entity. In your example it would be:
_Assets.h
_Assets.m
Assets.h
Assets.m
don't touch the _Assets.h and _Assets.m files, do all what you need in Assets.h and Assets.m.
Hope it helps
Add Core Data
You need to add core data framework as suggested by Ali3n.
How To Add A Framework
If you don't know how to add a framework to your project do the following:
In the project navigator, select your project
Select your target
Select the 'Build Phases' tab
Open 'Link Binaries With Libraries' expander
Click the '+' button
Select your framework
(optional) Drag and drop the added framework to the 'Frameworks' group
Link to the original post: How to "add existing frameworks" in Xcode 4?
I got the linker error because I only imported the "human" files into my project and not the "machine" files.
I want to login with facebook account in my application. For that i read developers.facebook.com documentation. I have installed everything. When i put FBConnect in my application, then i get this error:
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
Ld build/Debug-iphonesimulator/RunnoNavTest.app/RunnoNavTest normal i386
cd "/Users/arashsaeidihaghi/Documents/Mahmood/iPhone Apps/RunnoNavTest"
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/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk "-L/Users/arashsaeidihaghi/Documents/Mahmood/iPhone Apps/RunnoNavTest/build/Debug-iphonesimulator" "-F/Users/arashsaeidihaghi/Documents/Mahmood/iPhone Apps/RunnoNavTest/build/Debug-iphonesimulator" -filelist "/Users/arashsaeidihaghi/Documents/Mahmood/iPhone Apps/RunnoNavTest/build/RunnoNavTest.build/Debug-iphonesimulator/RunnoNavTest.build/Objects-normal/i386/RunnoNavTest.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics -framework CoreLocation -framework MediaPlayer -framework MapKit -lz.1.2.3 -framework CFNetwork -framework MobileCoreServices -framework SystemConfiguration -o "/Users/arashsaeidihaghi/Documents/Mahmood/iPhone Apps/RunnoNavTest/build/Debug-iphonesimulator/RunnoNavTest.app/RunnoNavTest"
ld: duplicate symbol _SBJSONErrorDomain in /Users/arashsaeidihaghi/Documents/Mahmood/iPhone Apps/RunnoNavTest/build/RunnoNavTest.build/Debug-iphonesimulator/RunnoNavTest.build/Objects-normal/i386/SBJsonBase-8058DE1040F45B54.o and /Users/arashsaeidihaghi/Documents/Mahmood/iPhone Apps/RunnoNavTest/build/RunnoNavTest.build/Debug-iphonesimulator/RunnoNavTest.build/Objects-normal/i386/SBJsonBase-4E4B4560D6FF6850.o
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
ld: duplicate symbol _SBJSONErrorDomain in /Users/arashsaeidihaghi/Documents/Mahmood/iPhone Apps/RunnoNavTest/build/RunnoNavTest.build/Debug-iphonesimulator/RunnoNavTest.build/Objects-normal/i386/SBJsonBase-8058DE1040F45B54.o and /Users/arashsaeidihaghi/Documents/Mahmood/iPhone Apps/RunnoNavTest/build/RunnoNavTest.build/Debug-iphonesimulator/RunnoNavTest.build/Objects-normal/i386/SBJsonBase-4E4B4560D6FF6850.o
When i remove that FBConnect, then it again works fine. That FBConnect has a JSON folder and my application also has a JSON folder. But files in both folder have different names. How can i remove this error and make it work? Thanks in advance.
I think the file in the JSON folder is a duplicate.
I installed MGTwitterEngine in my iPhone app, and followed all the instructions, and now I get the following error:
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 failed with exit code 1
The full error text is:
Ld /Users/jason/Documents/iPad/build/Debug-iphonesimulator/FlashCards.app/FlashCards normal i386
cd /Users/jason/Documents/iPad/FlashCards
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/g++-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk -L/Users/jason/Documents/iPad/build/Debug-iphonesimulator -L/Users/jason/Documents/iPad/FlashCards/Classes -L/Users/jason/Documents/iPad/FlashCards/Classes/SAOAuthTwitterEngine -L/Users/jason/Documents/iPad/FlashCards/Classes -L/Users/jason/Documents/iPad/FlashCards/Classes/Simulator4 -F/Users/jason/Documents/iPad/build/Debug-iphonesimulator -filelist /Users/jason/Documents/iPad/build/FlashCards.build/Debug-iphonesimulator/FlashCards++.build/Objects-normal/i386/FlashCards.LinkFileList -mmacosx-version-min=10.6 -l teEngine -ObjC -all_load -Xlinker -objc_abi_version -Xlinker 2 /Users/jason/Documents/iPad/core-plot/build/Debug-iphonesimulator/libCorePlot-CocoaTouch.a -framework Foundation -framework UIKit -framework CoreGraphics -framework CoreData -licucore.A -framework QuartzCore -framework SystemConfiguration -framework Security -framework MessageUI -framework CFNetwork -framework AddressBook -framework AddressBookUI -framework AudioToolbox -lteEngine -lteEngine -lOAuth -lxml2.2.7.3 -o /Users/jason/Documents/iPad/build/Debug-iphonesimulator/FlashCards.app/FlashCards
ld: duplicate symbol _EstimateBas64DecodedDataSize in /Users/jason/Documents/iPad/FlashCards/Classes/SAOAuthTwitterEngine/libOAuth.a(Base64Transcoder.o) and /Users/jason/Documents/iPad/build/FlashCards.build/Debug-iphonesimulator/FlashCards++.build/Objects-normal/i386/Base64Transcoder.o
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 failed with exit code 1
Any idea what could be causing it?
Linker found a duplicate symbols for EstimateBas64DecodedDataSize function because in you project you are trying to link against static library libOAuth.a and Base64Transcoder.o which was built from the sources. Both of them contains this symbol and linker doesn't know which one it should pick. It's hard to tell how to resolve this issue in general case, but basically you have to make sure that this symbol is exported by exactly one file from linker's input.
Where did you get this MGTwitterEngine distribution? It will be much easier to solve this issue with actual code.