New Apple Mach-O link (id) error - objective-c

Last night, when I finished working on my project, there were no errors. But today, when I opened my project, I had the Apple Mach-O link (id) error. Here is the error: `Ld /Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Products/Debug-iphonesimulator/WhereAmI.app/WhereAmI normal i386
cd "/Users/chandlerdeangelis/Desktop/Real Estate App"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Products/Debug-iphonesimulator -F/Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Products/Debug-iphonesimulator -filelist /Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmI.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -framework MapKit -framework CoreLocation -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Products/Debug-iphonesimulator/WhereAmI.app/WhereAmI
duplicate symbol _OBJC_IVAR_$_WhereAmIAppDelegate._window in:
/Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIAppDelegate.o
/Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIViewController.o
duplicate symbol _OBJC_IVAR_$_WhereAmIAppDelegate._viewController in:
/Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIAppDelegate.o
/Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIViewController.o
duplicate symbol _OBJC_METACLASS_$_WhereAmIAppDelegate in:
/Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIAppDelegate.o
/Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIViewController.o
duplicate symbol _OBJC_CLASS_$_WhereAmIAppDelegate in:
/Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIAppDelegate.o
/Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIViewController.o
ld: 4 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`
Can anyone help me out?

Several symbols, (WhereAmIAppDelegate._window, WhereAmIAppDelegate._viewController, ...) are defined duplicate: in WhereAmIAppDelegate.o and in WhereAmIViewController.o.
A likely cause for this error is that you have imported an ".m" file instead of the ".h" file somewhere. Perhaps you have an #import "WhereAmIAppDelegate.m" in WhereAmIViewController.m" ?

Related

ld: library not found for -lcrt1.3.1.o clang: error: linker command failed with exit code 1 (use -v to see invocation)

im trying to run an application on a device, but its giving me the error above, i searched for answers , but didnt find a solution,
no pods are used in this project, when trying to run it on a device, this error is been displayed:
Ld /Users/macuser/Library/Developer/Xcode/DerivedData/ActN-bjtxkfskskvorugakawqftsijcrs/Build/Products/Debug-iphoneos/ActN.app/ActN normal armv7
cd /Volumes/Untitled/ActN
export IPHONEOS_DEPLOYMENT_TARGET=4.3
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk -L/Users/macuser/Library/Developer/Xcode/DerivedData/ActN-bjtxkfskskvorugakawqftsijcrs/Build/Products/Debug-iphoneos -L/Volumes/Untitled/ActN -F/Users/macuser/Library/Developer/Xcode/DerivedData/ActN-bjtxkfskskvorugakawqftsijcrs/Build/Products/Debug-iphoneos -filelist /Users/macuser/Library/Developer/Xcode/DerivedData/ActN-bjtxkfskskvorugakawqftsijcrs/Build/Intermediates/ActN.build/Debug-iphoneos/ActN.build/Objects-normal/armv7/ActN.LinkFileList -miphoneos-version-min=4.3 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/macuser/Library/Developer/Xcode/DerivedData/ActN-bjtxkfskskvorugakawqftsijcrs/Build/Intermediates/ActN.build/Debug-iphoneos/ActN.build/Objects-normal/armv7/ActN_lto.o -Xlinker -no_deduplicate -fobjc-link-runtime -framework CoreLocation -framework CoreData -lsqlite3 -framework UIKit -framework Foundation -framework CoreGraphics -Xlinker -dependency_info -Xlinker /Users/macuser/Library/Developer/Xcode/DerivedData/ActN-bjtxkfskskvorugakawqftsijcrs/Build/Intermediates/ActN.build/Debug-iphoneos/ActN.build/Objects-normal/armv7/ActN_dependency_info.dat -o /Users/macuser/Library/Developer/Xcode/DerivedData/ActN-bjtxkfskskvorugakawqftsijcrs/Build/Products/Debug-iphoneos/ActN.app/ActN
ld: library not found for -lcrt1.3.1.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This issue can be addressed by using a later min deploy version. I updated a project file to use Target->Deployment Target = 9.0 so that iOS 9 was the min deploy target and that fixed the linker error for me in Xcode.

objectiveflickr Apple Mach-O Linker Error

Using ObjectiveFlickr, Xcode 4.5.2, iOS 6.
When compiling, it gets me:
Ld /Users/axu/Library/Developer/Xcode/DerivedData/Shutterbug-ecsrjcjimihxevguffdchwqnqtzf/Build/Products/Debug-iphonesimulator/Shutterbug. app/Shutterbug normal i386
cd /Users/axu/prj/ios/Shutterbug
setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode. app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode. app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk - L/Users/axu/Library/Developer/Xcode/DerivedData/Shutterbug-ecsrjcjimihxevguffdchwqnqtzf/Build/Products/Debug-iphonesimulator - F/Users/axu/Library/Developer/Xcode/DerivedData/Shutterbug-ecsrjcjimihxevguffdchwqnqtzf/Build/Products/Debug-iphonesimulator -filelist /Users/axu/Library/Developer/Xcode/DerivedData/Shutterbug-ecsrjcjimihxevguffdchwqnqtzf/Build/Intermediates/Shutterbug.build/Debug- iphonesimulator/Shutterbug.build/Objects-normal/i386/Shutterbug.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime - Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.0 /Users/axu/Library/Developer/Xcode/DerivedData/Shutterbug- ecsrjcjimihxevguffdchwqnqtzf/Build/Products/Debug-iphonesimulator/ObjectiveFlickr/ObjectiveFlickr /Users/axu/Library/Developer/Xcode/DerivedData/Shutterbug-ecsrjcjimihxevguffdchwqnqtzf/Build/Products/Debug-iphonesimulator/libObjectiveFlickr.a - framework UIKit -framework Foundation -framework CoreGraphics -o /Users/axu/Library/Developer/Xcode/DerivedData/Shutterbug- ecsrjcjimihxevguffdchwqnqtzf/Build/Products/Debug-iphonesimulator/Shutterbug.app/Shutterbug
clang: error: no such file or directory: '/Users/axu/Library/Developer/Xcode/DerivedData/Shutterbug-ecsrjcjimihxevguffdchwqnqtzf/Build/Products/Debug- iphonesimulator/ObjectiveFlickr/ObjectiveFlickr'
I don't know why it is asking a **/ObjectiveFlickr/ObjectiveFlickr which I never set anywhere.
If you review the command starting with:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/...
you will find:
/Users/axu/Library/Developer/Xcode/DerivedData/Shutterbug-ecsrjcjimihxevguffdchwqnqtzf/Build/Products/Debug-iphonesimulator/ObjectiveFlickr/ObjectiveFlickr
So there is definitely something wrong in your project.
One easy way to check this is opening your *.xcodeproj/project.pbxproj project file in a text editor and search for ObjectiveFlickr to see if everything is correct.

Clang error:failed with exitcode 1(use -v to see invocation)

I am trying to develop an application in xcode using objective c with SUP backend.When I builded my project I got an error like
Ld /Users/chairman/Library/Developer/Xcode/DerivedData/New_App-brpimxjxwxsuimcjcfjjrmpnextw/Build/Products/Debug-iphonesimulator/New_App.app/New_App normal i386
cd /Users/chairman/Desktop/New_App/New_App
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/New_App-brpimxjxwxsuimcjcfjjrmpnextw/Build/Products/Debug-iphonesimulator -L/Users/chairman/Desktop/New_App/New_App/../../MAC_IOS/importing_Libraries/Libraries/Debug-iphoneos -L/Users/chairman/Desktop/New_App/New_App/../../MAC_IOS/importing_Libraries/Libraries/Debug-iphonesimulator -L/Users/chairman/Desktop/New_App/New_App/../../MAC_IOS/importing_Libraries/Libraries/Release-iphoneos -L/Users/chairman/Desktop/New_App/New_App/../../MAC_IOS/importing_Libraries/Libraries/Release-iphonesimulator -L/Users/chairman/Desktop/New_App/New_App/../../New_App_Data/importing_Libraries/Libraries/Debug-iphonesimulator -F/Users/chairman/Library/Developer/Xcode/DerivedData/New_App-brpimxjxwxsuimcjcfjjrmpnextw/Build/Products/Debug-iphonesimulator -filelist /Users/chairman/Library/Developer/Xcode/DerivedData/New_App-brpimxjxwxsuimcjcfjjrmpnextw/Build/Intermediates/New_App.build/Debug-iphonesimulator/New_App.build/Objects-normal/i386/New_App.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -lstdc++.6 -lz.1.2.5 -licucore.A -framework Security -framework QuartzCore -framework CoreFoundation -framework AddressBook -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/chairman/Library/Developer/Xcode/DerivedData/New_App-brpimxjxwxsuimcjcfjjrmpnextw/Build/Products/Debug-iphonesimulator/New_App.app/New_App
ld: duplicate symbol _OBJC_IVAR_$_dev_BhaskarG_com_igate_shipping_v1KeyGenerator._remoteId in /Users/chairman/Library/Developer/Xcode/DerivedData/New_App-brpimxjxwxsuimcjcfjjrmpnextw/Build/Intermediates/New_App.build/Debug-iphonesimulator/New_App.build/Objects-normal/i386/dev_BhaskarG_com_igate_shipping_v1KeyGenerator.o and /Users/chairman/Library/Developer/Xcode/DerivedData/New_App-brpimxjxwxsuimcjcfjjrmpnextw/Build/Intermediates/New_App.build/Debug-iphonesimulator/New_App.build/Objects-normal/i386/dev_BhaskarG_com_igate_shipping_v1KeyGenerator copy.o for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can anyone please help me in solving this?
Duplicate symbol means you have the same symbol (class, variable, etc) defined in two places in your project (or its included libraries).
Look at the error messages...it looks like you've included the same file in your project twice:
dev_BhaskarG_com_igate_shipping_v1KeyGenerator
dev_BhaskarG_com_igate_shipping_v1KeyGenerator copy

error: linker command failed with exit code 1 (use -v to see invoc

I am getting this error message below. i have tried the surgestion on stackoverflow and searched for other solution but they do not work. Can any one help with this?
> setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -L/Users/stuart/Library/Developer/Xcode/DerivedData/tab_project-evwkhgsuxscoetcgithrfgftafyk/Build/Products/Debug-iphonesimulator -F/Users/stuart/Library/Developer/Xcode/DerivedData/tab_project-evwkhgsuxscoetcgithrfgftafyk/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist "/Users/stuart/Library/Developer/Xcode/DerivedData/tab_project-evwkhgsuxscoetcgithrfgftafyk/Build/Intermediates/tab project.build/Debug-iphonesimulator/tab projectTests.build/Objects-normal/i386/tab projectTests.LinkFileList" -bundle_loader "/Users/stuart/Library/Developer/Xcode/DerivedData/tab_project-evwkhgsuxscoetcgithrfgftafyk/Build/Products/Debug-iphonesimulator/tab project.app/tab project" -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.0 -framework SenTestingKit -framework UIKit -framework Foundation -o "/Users/stuart/Library/Developer/Xcode/DerivedData/tab_project-evwkhgsuxscoetcgithrfgftafyk/Build/Products/Debug-iphonesimulator/tab projectTests.octest/tab projectTests"
ld: file not found: /Users/stuart/Library/Developer/Xcode/DerivedData/tab_project-evwkhgsuxscoetcgithrfgftafyk/Build/Products/Debug-iphonesimulator/tab project.app/tab project
clang: error: linker command failed with exit code 1 (use -v to see invocation)
You may have added files to your solution/project via drag'n'drop.
Try this:
Select your project
Go to Build Phases Tab
Expand Compile Sources
Hit the "+" and add all the *.m files that you want included in your build

Error "file not found: -fobjc-arc" on compiling IOS App in XCode

after adding the OCMock framework i got that strange error... :(
ld: file not found: -fobjc-arc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It looks like if the compiler flag tries to be loaded by XCode?
Any idea?
Best regards, hijolan
I was getting the exact same error on Xcode 4.3.2. Here's my navigator log; I'm adding it for Google juice.
Ld /Users/makdad/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator/JournalTests.octest/JournalTests normal i386
cd /Users/makdad/Documents/MT/mt-mobile/iOS/Journal
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator -F/Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Intermediates/Journal.build/Debug-iphonesimulator/JournalTests.build/Objects-normal/i386/JournalTests.LinkFileList -mmacosx-version-min=10.6 -bundle_loader /Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator/Journal.app/Journal -Xlinker -objc_abi_version -Xlinker 2 -ObjC -force_load -fobjc-arc -ftest-coverage -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=40100 -lOCMock -framework Twitter -framework MapKit -framework MobileCoreServices -framework SystemConfiguration -lxml2 -licucore -framework CoreData -framework CoreGraphics -framework CFNetwork -framework QuartzCore -framework SenTestingKit -framework UIKit -framework Foundation -o /Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator/JournalTests.octest/JournalTests
The OCMock instructions explicitly ask you to add linker flags -- -ObjC and -force_load.
-force_load is expecting a value -- see the answer to this question that explains that -all_load is what to use if you don't want to specify a library name.
As someone who just spent 25 minutes on this, I should check again with the OCMock tutorial -- I don't think it was very clear in this instruction.
This blog post has a much better image that shows exactly how your settings should look.