Quickblox linker error: operator delete(void*)", referenced from - ios

I'm creating a simple chat app with Quickblox.
So I added the project to XCode exactly like in this tutorial: http://quickblox.com/developers/IOS-how-to-connect-Quickblox-framework
QBUsers class worked just fine, but when I used QBChat I started to get linker errors:
Undefined symbols for architecture i386:
"operator delete(void*)", referenced from:
-[QBVideoChat initAudioCapture] in Quickblox(QBVideoChat.o)
"operator new(unsigned long)", referenced from:
-[QBVideoChat initAudioCapture] in Quickblox(QBVideoChat.o)
"___gxx_personality_v0", referenced from:
Dwarf Exception Unwind Info (__eh_frame) in Quickblox(QBVideoChat.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here's the line that causes the problem (if I comment it out, linker errors go away):
[[QBChat instance] setDelegate:self];
The class in which the problem occurs implements the following protocols:
<QBActionStatusDelegate, QBChatDelegate>
Here's the list of frameworks I imported to the project:
-lxml2 -lresolv -lz -framework AVFoundation -framework CoreVideo -framework Accelerate -framework CoreMedia -framework AudioToolbox -framework CoreData -framework CoreLocation -framework CoreGraphics -framework MobileCoreServices -framework SystemConfiguration -framework CFNetwork -framework Quickblox -framework UIKit -framework Foundation

As it was suggested in comments by Greg Parker, I added libc++.dylib to the project and everything worked.

I had the same problem, I added the libc++ and resolved

For iOS9 do following in your application's target:
in build phases->Link Binary With Libraries ->search and add 'libstdc++.tbd'
In case you're trying to add this in a library target this won't work. the 'libstdc++.tbd' is not an object file so it can't be added into an objective-c library's target, it needs to be added in an application that wants to use the library.

Related

Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods

When integrating the Apptentive iOS SDK via Cocoapods, I get the following errors:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ATConnect", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_ATAppRatingFlow", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_ATSurveys", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang:
error: linker command failed with exit code 1 (use -v to see invocation)
How should these errors be fixed?
We have found that adding the Apptentive cocoa pod to an existing Xcode project may potentially not include some of our required frameworks.
Check your linker flags:
Target > Build Settings > Other Linker Flags
You should see -lApptentiveConnect listed as a linker flag:
... -ObjC -lApptentiveConnect ...
You should also see our required Frameworks listed:
Accelerate
CoreData
CoreText
CoreGraphics
CoreTelephony
Foundation
QuartzCore
StoreKit
SystemConfiguration
UIKit
-ObjC -lApptentiveConnect -framework Accelerate -framework CoreData -framework CoreGraphics -framework CoreText -framework Foundation -framework QuartzCore -framework SystemConfiguration -framework UIKit -framework CoreTelephony -framework StoreKit

Mach-O Linker Error Xcode 5

I have just updated my Xcode to version 5.0.2
And after updating, all my previously running apps (*perfectly running and archiving) are now giving following errors when I try to archive them for testing on my devices (not connected devices).
Ld /Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/IntermediateBuildFilesPath/lite_test.build/Release-iphoneos/lite_test.build/Objects-normal/armv7s/lite_test normal armv7s
cd /Users/dharammalik/Documents/PhonegapWorkspace/lite_test
setenv IPHONEOS_DEPLOYMENT_TARGET 5.0
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/iPhoneOS7.0.sdk -L/Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/BuildProductsPath/Release-iphoneos -F/Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/BuildProductsPath/Release-iphoneos -filelist /Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/IntermediateBuildFilesPath/lite_test.build/Release-iphoneos/lite_test.build/Objects-normal/armv7s/lite_test.LinkFileList -dead_strip -weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -all_load -Obj-C -fobjc-link-runtime -miphoneos-version-min=5.0 -framework CoreLocation -framework ImageIO -framework OpenAL -framework AssetsLibrary /Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/BuildProductsPath/Release-iphoneos/libCordova.a -framework Foundation -weak_framework UIKit -framework CoreGraphics -framework AddressBook -framework AddressBookUI -framework AudioToolbox -weak_framework AVFoundation -framework CFNetwork -framework MediaPlayer -framework QuartzCore -framework SystemConfiguration -framework MobileCoreServices -weak_framework CoreMedia -framework CoreLocation -Xlinker -dependency_info -Xlinker /Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/IntermediateBuildFilesPath/lite_test.build/Release-iphoneos/lite_test.build/Objects-normal/armv7s/lite_test_dependency_info.dat -o /Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/IntermediateBuildFilesPath/lite_test.build/Release-iphoneos/lite_test.build/Objects-normal/armv7s/lite_test
ld: warning: ignoring file /Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/BuildProductsPath/Release-iphoneos/libCordova.a, file was built for archive which is not the architecture being linked (armv7s): /Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/BuildProductsPath/Release-iphoneos/libCordova.a
Undefined symbols for architecture armv7s:
"_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
"_CDVLocalNotification", referenced from:
-[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
"_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
"_OBJC_CLASS_$_CDVCommandQueue", referenced from:
_OBJC_CLASS_$_MainCommandQueue in MainViewController.o
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_MainViewController in MainViewController.o
"_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
_OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
"_CDVPluginHandleOpenURLNotification", referenced from:
-[AppDelegate application:handleOpenURL:] in AppDelegate.o
"_OBJC_CLASS_$_CDVViewController", referenced from:
_OBJC_CLASS_$_MainViewController in MainViewController.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Tried changing the Architectures, but nothing worked. Any idea how to resolve these issues? They were not there at all in the previous version of Xcode I had.
Remove armv7s from valid architectures section and it will work.
Build Settings --> Architectures --> Valid Architectures
Change the Buid setting ---> Architecture ---> Build Active Architecture only ---> Yes
This solved my issue for using old cordova versions in new Xcode 5
I had the same problem and the issue was that I have accidently imported a .m file instead of .h in an implementation file - hope it helps
libCordova.a, file was built for archive which is not the architecture being linked (armv7s)
Looks like your copy of libCordova framework does not contain a armv7s binary.
You need to change the Architectures in the CordovaLib project, not in your lite_test project. I assume when you said you tried changing the Architectures, you only tried in your project and not the Cordova project (since changing in Cordova worked for me) . Remember that Cordova is a dependent project and is compiled into the binary each time you run.

Linker Error When Integrating iOS and the Google Plus SDK

I'm trying to use the Google Plus SDK for sharing in an iOS 6.1 app and get a linker error after adding the GooglePlus.framework and the GoogleOpenSource.framework.
Merely including the frameworks and building yields the following errors:
Undefined symbols for architecture armv7:
"_CGRectDivide", referenced from:
-[GTMOAuth2ViewControllerTouch moveWebViewFromUnderNavigationBar] in GTMOAuth2ViewControllerTouch.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've followed instructions found in the Google guide to no avail.
I've done the following:
Included SystemConfiguration.framework and Security.framework
Dragged and dropped the GooglePlus.framework and the GoogleOpenSource.framework
from the SDK into my XCode project
Added the -ObjC flag to the app target's build settings
In addition to the previous steps I also tried adding the contents of the OpenSource folder provided in the SDK but that had no effect caused additional problems after the initial fix.
Libraries:
Full error message:
Ld "/Users/me/Library/Developer/Xcode/DerivedData/MyApp-asdf/Build/Intermediates/MyApp.build/
Debug-iphoneos/MyAoo.build/Objects-normal/armv7/MyApp" normal armv7
cd /Users/me/code/MyApp
setenv IPHONEOS_DEPLOYMENT_TARGET 6.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 armv7 -isysroot
/Applications/Xcode.app/Contents/Developer/
Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
-L/Users/me/Library/Developer/Xcode/DerivedData/
MyApp-asdf/Build/Products/Debug-iphoneos
-L/Users/me/code/MyApp/MyApp
-F/Users/me/Library/Developer/Xcode/DerivedData/MyApp-asdf/Build/Products/Debug-iphoneos
-F/Users/me/code/MyApp/../../Documents/FacebookSDK -F/Users/me/code/MyApp
-F/Users/me/code/MyApp/MyApp
-filelist "/Users/me/Library/Developer/Xcode/
DerivedData/MyApp-asdf/Build/Intermediates/
MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/armv7/MyApp.LinkFileList"
-dead_strip -ObjC -lsqlite3.0 -fobjc-arc
-fobjc-link-runtime -miphoneos-version-min=6.1
-framework SystemConfiguration -framework Security
-framework CFNetwork -framework Social -framework Accounts
-framework EventKit -framework EventKitUI
-framework AVFoundation -framework MapKit
-framework Twitter -framework CoreMotion -framework CoreLocation
-lxml2 -framework QuartzCore
-framework MobileCoreServices -framework CoreData
-framework UIKit -framework Foundation
-framework Pinterest -framework GooglePlus
-framework GoogleOpenSource
-lGooglePlusUniversal -o
"/Users/me/Library/Developer/
Xcode/DerivedData/MyApp-asdf/Build/Intermediates/MyApp.build/
Debug-iphoneos/MyApp.build/Objects-normal/armv7/MyApp"
Undefined symbols for architecture armv7:
"_CGRectDivide", referenced from:
-[GTMOAuth2ViewControllerTouch moveWebViewFromUnderNavigationBar] in
GTMOAuth2ViewControllerTouch.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm not sure what I missed but any help would be greatly appreciated.
Also link in the CoreGraphics framework. It's looking for the CGRectDivide method, which is part of CoreGraphics.
This error is caused by adding OpenSource folder to you project, xcode detects that there is a duplication of files. So you should only add GooglePlus.framework and the GoogleOpenSource.framework.

iOS Linking Issues for iOS6 and Armv7

I've recently opened my previously working apps (before i upgraded to the new Xcode for iOS6) and i'm getting some errors. I've redownloaded the frameworks that were kicking back the errors but those same frameworks now seem to be giving me more trouble. Below is the error...
Ld /Users/JohnSlater/Library/Developer/Xcode/DerivedData/iFestApp-avmgjnvetjnjecdjprczkbgdkfas/Build/Intermediates/iFestApp.build/Debug-iphoneos/iFestApp.build/Objects-normal/armv7/iFestApp normal armv7
cd "/Users/JohnSlater/Desktop/iOS Apps/iFestival for V 2012"
setenv IPHONEOS_DEPLOYMENT_TARGET 5.0
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 armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -L/Users/JohnSlater/Library/Developer/Xcode/DerivedData/iFestApp-avmgjnvetjnjecdjprczkbgdkfas/Build/Products/Debug-iphoneos "-L/Users/JohnSlater/Desktop/iOS Apps/iFestival for V 2012/iFestApp/Resources/Frameworks/Airship" -F/Users/JohnSlater/Library/Developer/Xcode/DerivedData/iFestApp-avmgjnvetjnjecdjprczkbgdkfas/Build/Products/Debug-iphoneos -filelist /Users/JohnSlater/Library/Developer/Xcode/DerivedData/iFestApp-avmgjnvetjnjecdjprczkbgdkfas/Build/Intermediates/iFestApp.build/Debug-iphoneos/iFestApp.build/Objects-normal/armv7/iFestApp.LinkFileList -dead_strip -fobjc-link-runtime -miphoneos-version-min=5.0 -framework QuartzCore -framework Security -framework AudioToolbox -framework MessageUI -framework StoreKit -framework CoreTelephony -lsqlite3 -framework AVFoundation -lz -framework MobileCoreServices -framework SystemConfiguration -framework CFNetwork -framework CoreLocation -framework MapKit -framework UIKit -framework Foundation -framework CoreGraphics -lUAirship-1.3.3 -lUAirshipPush-1.3.3 -o /Users/JohnSlater/Library/Developer/Xcode/DerivedData/iFestApp-avmgjnvetjnjecdjprczkbgdkfas/Build/Intermediates/iFestApp.build/Debug-iphoneos/iFestApp.build/Objects-normal/armv7/iFestApp
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_TestFlight", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_FlurryAnalytics", referenced from:
objc-class-ref in AppDelegate.o
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can anyone give me some guidance as i've been unable to find a straight answer.
Thanks.
If you want to support iPhone 5 configurations you have to reconfigure the whole project and make it run with armv7s architecture.
If you just want to get rid of the errors you should remove all the armv7s references, including all libs.
This may help a little: Moving to iOS6 I get this linker error with almost all external packages

Xcode: symbol(s) not found for architecture armv7

I have this message from Xcode
Ld /Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-gqsubryokdmrjmczxeqypzcgpths/Build/Intermediates/myApp.build/Debug-iphoneos/myApp.build/Objects-normal/armv7/myApp normal armv7
cd /Users/myUsername/Documents/_IPAD/myApp
setenv IPHONEOS_DEPLOYMENT_TARGET 4.3
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 armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -L/Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-gqsubryokdmrjmczxeqypzcgpths/Build/Products/Debug-iphoneos -F/Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-gqsubryokdmrjmczxeqypzcgpths/Build/Products/Debug-iphoneos -filelist /Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-gqsubryokdmrjmczxeqypzcgpths/Build/Intermediates/myApp.build/Debug-iphoneos/myApp.build/Objects-normal/armv7/myApp.LinkFileList -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=4.3 -framework AudioToolbox -framework SystemConfiguration -framework QuartzCore -framework OpenAL -framework CoreGraphics -framework CFNetwork -framework MessageUI -framework CoreData -framework AVFoundation -framework StoreKit -framework UIKit -framework Foundation -o /Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-gqsubryokdmrjmczxeqypzcgpths/Build/Intermediates/myApp.build/Debug-iphoneos/myApp.build/Objects-normal/armv7/myApp
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_ViewController", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What exactly is not found? If it is saying that something was not found where is this not found stuff being looked for? Or in other words, if xcode is searching for something it is searching somewhere, where and what?
The ViewController object is not found and it was referenced within AppDelegate. You do not link ViewController into your app. Check if your Compile Sources section within the Build Phases of your project shows ViewController.m.
I just ran into this. Turns out I didn't add the new source to all of the targets that needed it. Maybe this will help someone in the future.. :)
I got same error after updating xCode 6beta to xCode 6.0.1. After spending a lot of time I fixed it by deleting "Derived Data" from Window -> Organizer -> Projects -> #Select project# and pressed Delete in the "Derived Data".

Resources