Error when compiling in the device? - iphone

I am getting the below error as "apple mach-o linker error xcode"
Ld "/Users/admin/Library/Developer/Xcode/DerivedData/Voice_-flsfylxijlgswbbqkqwjspmgcska/Build/Intermediates/Voice .build/Debug-iphoneos/Voice .build/Objects-normal/armv6/Voice " normal armv6
cd "/Users/admin/Desktop/Voice "
setenv IPHONEOS_DEPLOYMENT_TARGET 4.0
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-g++-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk -L/Users/admin/Library/Developer/Xcode/DerivedData/Voice_-flsfylxijlgswbbqkqwjspmgcska/Build/Products/Debug-iphoneos "-L/Users/admin/Desktop/Voice /../Common Files/src" -F/Users/admin/Library/Developer/Xcode/DerivedData/Voice_-flsfylxijlgswbbqkqwjspmgcska/Build/Products/Debug-iphoneos -filelist "/Users/admin/Library/Developer/Xcode/DerivedData/Voice_-flsfylxijlgswbbqkqwjspmgcska/Build/Intermediates/Voice .build/Debug-iphoneos/Voice .build/Objects-normal/armv6/Voice .LinkFileList" -dead_strip -miphoneos-version-min=4.0 -framework AudioUnit -framework OpenAL -framework AVFoundation -framework AudioToolbox -framework CoreAudio -framework Accelerate -framework UIKit -framework Foundation -framework CoreGraphics -lDIRAC_iOS4-fat -o "/Users/admin/Library/Developer/Xcode/DerivedData/Voice_-flsfylxijlgswbbqkqwjspmgcska/Build/Intermediates/Voice .build/Debug-iphoneos/Voice .build/Objects-normal/armv6/Voice "
ld: warning: directory not found for option '-L/Users/admin/Desktop/Voice /../Common Files/src'
ld: framework not found AudioUnit
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-g++-4.2 failed with exit code 1
Please help me,
I did not get any solution even I added Audio unit framework it displays same error.
Madan Mohan

Have you tried doing a clean and then setting up your frameworks again?

I think you should add the audio unit framework and create "-L/Users/admin/Desktop/Voice /../Common Files/src" what are you doing with this dir?

Related

Apple Mach-O Linker Errors Xcode

I got this Error from Xcode when trying to run my app on my device.
Ld "/Users/admin/Library/Developer/Xcode/DerivedData/Store_Locator_In_App-hbygxaouhvxmvwdudbwamekfbima/Build/Intermediates/Store Locator In App.build/Debug-iphoneos/Store Locator In App.build/Objects-normal/armv7s/Store Locator In App" normal armv7s
cd "/Users/admin/Desktop/peboom 5"
setenv IPHONEOS_DEPLOYMENT_TARGET 5.1
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -L/Users/admin/Library/Developer/Xcode/DerivedData/Store_Locator_In_App-hbygxaouhvxmvwdudbwamekfbima/Build/Products/Debug-iphoneos "-L/Users/admin/Desktop/peboom 5" -F/Users/admin/Library/Developer/Xcode/DerivedData/Store_Locator_In_App-hbygxaouhvxmvwdudbwamekfbima/Build/Products/Debug-iphoneos -filelist "/Users/admin/Library/Developer/Xcode/DerivedData/Store_Locator_In_App-hbygxaouhvxmvwdudbwamekfbima/Build/Intermediates/Store Locator In App.build/Debug-iphoneos/Store Locator In App.build/Objects-normal/armv7s/Store Locator In App.LinkFileList" -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=5.1 -lsqlite3.0 -framework MediaPlayer -framework AudioToolbox -framework AVFoundation -framework SystemConfiguration -framework CFNetwork -framework MobileCoreServices -framework MessageUI -framework CoreLocation -framework QuartzCore -framework MapKit -framework UIKit -framework Foundation -framework CoreGraphics -lGoogleAnalytics_NoThumb -lGoogleAnalytics -o "/Users/admin/Library/Developer/Xcode/DerivedData/Store_Locator_In_App-hbygxaouhvxmvwdudbwamekfbima/Build/Intermediates/Store Locator In App.build/Debug-iphoneos/Store Locator In App.build/Objects-normal/armv7s/Store Locator In App"
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/admin/Desktop/peboom 5/libGoogleAnalytics_NoThumb.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The new iPhone 5 processor has a custom ARMv7 core which uses a new architecture called armv7s.
The linker is returning that error because the armv7s slice is missing from the libGoogleAnalytics_NoThumb library you're referencing in your project.
Simply update the GoogleAnalitics SDK to the latest version (1.5.1) you can download here: https://developers.google.com/analytics/devguides/collection/ios/resources

MGTwitterEngine throws error: g++-4.2 failed with exit code 1

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.

Apple Push notification Problem gcc-4.2 failed with exit code 1

I almost done my app but suddenly an error appear
The ERROR:
Ld build/urbantest.build/Release-iphoneos/urbantest.build/Objects-normal/armv7/urbantest normal armv7
cd /Users/mbp/Apps/Testing/urbantest
setenv IPHONEOS_DEPLOYMENT_TARGET 4.1
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk -L/Users/mbp/Apps/Testing/urbantest/build/Release-iphoneos -L/Users/mbp/Apps/Testing/urbantest/Airship -F/Users/mbp/Apps/Testing/urbantest/build/Release-iphoneos -filelist /Users/mbp/Apps/Testing/urbantest/build/urbantest.build/Release-iphoneos/urbantest.build/Objects-normal/armv7/urbantest.LinkFileList -dead_strip -all_load -weak_library /usr/lib/libSystem.B.dylib -miphoneos-version-min=4.1 -framework Foundation -framework UIKit -framework CoreGraphics -lUAirship-1.0.4 -framework AudioToolbox -framework MessageUI -framework CFNetwork -framework CoreTelephony -framework MobileCoreServices -framework Security -framework StoreKit -framework SystemConfiguration -lsqlite3 -lz -o /Users/mbp/Apps/Testing/urbantest/build/urbantest.build/Release-iphoneos/urbantest.build/Objects-normal/armv7/urbantest
ld: duplicate symbol _OBJC_CLASS_$_UA_ASIDownloadCache in /Users/mbp/Apps/Testing/urbantest/Airship/libUAirship-1.0.4.a(UA_ASIDownloadCache.o) and /Users/mbp/Apps/Testing/urbantest/build/urbantest.build/Release-iphoneos/urbantest.build/Objects-normal/armv7/UA_ASIDownloadCache.o
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
Plz help me solve it.
Seem like you are trying to use AirShip library for Push Notification that embed ASIHTTPRequest library. Have you also add by yourself ASIHTTPRequest for network stuff?
If yes the linker found two symbol with the same name (= two definition for the same class) one in AirShip Library and One in ASIHHTPRequest.
You can remove your ASIHTTPRequest and use the one shipped with AirShip library.

Duplicate Symbol Linker error XCode 3.2.5 -- linker seems to reference same file in different ways

I get the following error:
ld: duplicate symbol
_TTCreateNonRetainingArray in /Users/macuser/Dropbox/DFJ/three20/Build/Products/Debug-iphoneos/libThree20Core.a(TTGlobalCore.o)
and
../three20/Build/Products/Debug-iphoneos/libThree20Core.a(TTGlobalCore.o)
collect2: ld returned 1 exit status
Command
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2
failed with exit code 1
It seems to be referring to the same .o from an absolute and relative paths.
Ld
build/DFJ.build/Debug-iphoneos/DFJ.build/Objects-normal/armv6/DFJ
normal armv6 cd
/Users/macuser/Dropbox/DFJ/DFJ setenv
IPHONEOS_DEPLOYMENT_TARGET 3.2 setenv
PATH
"/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2
-arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk
-L/Users/macuser/Dropbox/DFJ/DFJ/build/Debug-iphoneos
-F/Users/macuser/Dropbox/DFJ/DFJ/build/Debug-iphoneos
-F/Users/macuser/Dropbox/DFJ/DFJ/../../../Downloads/gdata-objectivec-client-1.11.0/Source/build/Debug
-filelist /Users/macuser/Dropbox/DFJ/DFJ/build/DFJ.build/Debug-iphoneos/DFJ.build/Objects-normal/armv6/DFJ.LinkFileList
-dead_strip -force_load ../three20/Build/Products/Debug-iphoneos/libThree20Core.a
-force_load ../three20/Build/Products/Debug-iphoneos/libThree20UICommon.a
-force_load ../three20/Build/Products/Debug-iphoneos/libThree20Launcher.a
-force_load ../three20/Build/Products/Debug-iphoneos/libThree20UINavigator.a
-force_load ../three20/Build/Products/Debug-iphoneos/libThree20.a
-force_load ../three20/Build/Products/Debug-iphoneos/libThree20UI.a
-force_load ../three20/Build/Products/Debug-iphoneos/libThree20Network.a
-force_load ../three20/Build/Products/Debug-iphoneos/libThree20Style.a
-all_load -miphoneos-version-min=3.2 /Users/macuser/Dropbox/DFJ/three20/Build/Products/Debug-iphoneos/libThree20Core.a
/Users/macuser/Dropbox/DFJ/three20/Build/Products/Debug-iphoneos/libThree20UICommon.a
/Users/macuser/Dropbox/DFJ/three20/Build/Products/Debug-iphoneos/libThree20Launcher.a
/Users/macuser/Dropbox/DFJ/three20/Build/Products/Debug-iphoneos/libThree20UINavigator.a
/Users/macuser/Dropbox/DFJ/three20/Build/Products/Debug-iphoneos/libThree20.a
/Users/macuser/Dropbox/DFJ/three20/Build/Products/Debug-iphoneos/libThree20UI.a
/Users/macuser/Dropbox/DFJ/three20/Build/Products/Debug-iphoneos/libThree20Network.a
/Users/macuser/Dropbox/DFJ/three20/Build/Products/Debug-iphoneos/libThree20Style.a
-framework QuartzCore -framework Foundation -framework UIKit -framework
CoreGraphics -lsqlite3.0 -framework
MobileCoreServices -lxml2 -framework
Security -framework
SystemConfiguration -framework OpenAL
-framework CoreAudio -framework AudioToolbox -o
/Users/macuser/Dropbox/DFJ/DFJ/build/DFJ.build/Debug-iphoneos/DFJ.build/Objects-normal/armv6/DFJ
ld: duplicate symbol
_TTCreateNonRetainingArray in /Users/macuser/Dropbox/DFJ/three20/Build/Products/Debug-iphoneos/libThree20Core.a(TTGlobalCore.o)
and
../three20/Build/Products/Debug-iphoneos/libThree20Core.a(TTGlobalCore.o)
collect2: ld returned 1 exit status
Command
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2
failed with exit code 1
See the last message of the developer of Three20 here. Basically, download the newest Three20 sources and follow closely the steps described in their README.
If you are following a Three20 tutorial that is not coming from the developer, chances are it's outdated.

Strange error after upgrading to Xcode 3.2.5 ld: file not found: -miphoneos-version-min=3.2

I have been banging my head on this for a while now. What is the problem? btw. I am using the Three20 Libraries in my project in case that has anything to do with.
Ld build/DFJ.build/Debug-iphoneos/DFJ.build/Objects-normal/armv6/DFJ normal armv6
cd /Users/macuser/Dropbox/DFJ/DFJ
setenv IPHONEOS_DEPLOYMENT_TARGET 3.2
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk -L/Users/macuser/Dropbox/DFJ/DFJ/build/Debug-iphoneos -F/Users/macuser/Dropbox/DFJ/DFJ/build/Debug-iphoneos -F/Users/macuser/Dropbox/DFJ/DFJ/../../../Downloads/gdata-objectivec-client-1.11.0/Source/build/Debug -filelist /Users/macuser/Dropbox/DFJ/DFJ/build/DFJ.build/Debug-iphoneos/DFJ.build/Objects-normal/armv6/DFJ.LinkFileList -dead_strip -all_load -force_load -miphoneos-version-min=3.2 -framework QuartzCore -framework Foundation -framework UIKit -framework CoreGraphics -lsqlite3.0 -framework MobileCoreServices -lxml2 -framework Security -framework SystemConfiguration -framework OpenAL -framework CoreAudio -framework AudioToolbox -o /Users/macuser/Dropbox/DFJ/DFJ/build/DFJ.build/Debug-iphoneos/DFJ.build/Objects-normal/armv6/DFJ
ld: file not found: -miphoneos-version-min=3.2
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2 failed with exit code 1
You are getting that error because of this part of the ld command line:
-force_load -miphoneos-version-min=3.2
The -force_load option expects to be followed by a filename, but no filename is present so it's taking the next option (-miphoneos-version-min=3.2) and trying to interpret it as a filename.
Take a look at your build settings in XCode to see where that -force_load flag is being specified...