This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
error when import zlib in iOS: symbol(s) not found collect2: ld
I am working on iphone project and I need a library to extract ZIP file
I found ZipArchive but it doesn't compatible with ARC and when I add -fno-objc-arc to compile files I get linker error:
Undefined symbols for architecture i386:
"_inflateEnd", referenced from:
_unzCloseCurrentFile in unzip.o
"inflateInit2", referenced from:
_unzOpenCurrentFile3 in unzip.o
"_get_crc_table", referenced from:
_unzOpenCurrentFile3 in unzip.o
_zipOpenNewFileInZip3 in zip.o
"_crc32", referenced from:
_unzReadCurrentFile in unzip.o
_zipWriteInFileInZip in zip.o
-[ZipArchive addFileToZip:newname:] in ZipArchive.o
"_inflate", referenced from:
_unzReadCurrentFile in unzip.o
"deflateInit2", referenced from:
_zipOpenNewFileInZip3 in zip.o
"_deflate", referenced from:
_zipWriteInFileInZip in zip.o
_zipCloseFileInZipRaw in zip.o
"_deflateEnd", referenced from:
_zipCloseFileInZipRaw in zip.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
For the undefined symbols, you need to add libz to the linked libraries. See: error when import zlib in iphone sdk
Related
I am a beginner in iOS app development. I am currently working on a project that needs to be changed from Parse to Firebase`.
I installed cocoa pods and "firebase/core" pod as firebase site instructed.
Imported firebase.h in appdelegate.h
Added [FIRApp configure]; in 'didfinishlaunchingwithoptions'
Added 'googleservice-info.plist' in project.
After doing these steps, I ran the build but it failed with following errors (Screen Shot)
Showing Recent Issues
Ld /Users/../Build/Products/Debug-iphonesimulator/Example.app/Example
Apple Mach-O Linker Error Group
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FBAppCall", referenced from:
objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o)
"_OBJC_CLASS_$_FBSession", referenced from:
objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o)
"_FBTokenInformationExpirationDateKey", referenced from:
-[PFFacebookTokenCachingStrategy cacheTokenInformation:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy expirationDate] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setExpirationDate:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
"_OBJC_METACLASS_$_FBSessionTokenCachingStrategy", referenced from:
_OBJC_METACLASS_$_PFFacebookTokenCachingStrategy in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
"_OBJC_CLASS_$_FBSessionTokenCachingStrategy", referenced from:
_OBJC_CLASS_$_PFFacebookTokenCachingStrategy in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
"_OBJC_CLASS_$_FBRequest", referenced from:
objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o)
"_FBTokenInformationUserFBIDKey", referenced from:
-[PFFacebookTokenCachingStrategy facebookId] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setFacebookId:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
"_FBTokenInformationTokenKey", referenced from:
-[PFFacebookTokenCachingStrategy accessToken] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setAccessToken:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I know this has something to do with the parse code in my project but I don't have much knowledge in Parse or in Firebase.
Please help me with this error and guide me how to successfully migrate from Parse to Firebase.
If you used Parse SDK, just make sue you delete ParseFacebookUtils.framework library from your project or from your podfile remove
pod 'Parse'
pod 'ParseFacebookUtilsV4'
I am trying to integrate Stripe with Xcode using Swift. I installed the podfile for Stripe and imported #import "Stripe.h" to my bridging file. All of other files in the bridge file work fine except Stripe. This is the error that i get when i initialize Stripe.setDefaultPublishableKey(""):
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_Stripe", referenced from:
type metadata accessor for ObjectiveC.Stripe in AppDelegate.o
"_OBJC_CLASS_$_STPPaymentCardTextField", referenced from:
objc-class-ref in STPCheckoutView.o
"_OBJC_CLASS_$_STPAPIClient", referenced from:
objc-class-ref in STPCheckoutView.o
"_OBJC_CLASS_$_STPCard", referenced from:
objc-class-ref in STPCheckoutView.o
"_StripeDomain", referenced from:
-[STPCheckoutView createToken:] in STPCheckoutView.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any help would be much appreciated.
I git clone this ios project form
https://github.com/Azure/azure-mobile-services. That project is an example of using azure mobile service on ios. But when I compile it under XCode6, I get the follwing error:
ld: warning: ignoring file
/Users/JOHN/Src/iOS-MobileServices-Authentication/source/client/AuthenticationDemo/WindowsAzureMobileServices.framework/WindowsAzureMobileServices,
missing required architecture x86_64 in file
/Users/JOHN/Src/iOS-MobileServices-Authentication/source/client/AuthenticationDemo/WindowsAzureMobileServices.framework/WindowsAzureMobileServices
(3 slices) Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_MSClient", referenced from:
objc-class-ref in AuthService.o "_OBJC_CLASS_$_MSUser", referenced from:
objc-class-ref in AuthService.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code
1 (use -v to see invocation)
Does anyone know how to fix this?
Thank you.
In your project, build settings, set your valid architectures to just be "Standard Architecture (armv7, armv7s)" and not "Standard architectures (including 64-bit)"
and also set build active architecture only to No in all cases ie debug and release.
Currently the SDK is built with support for 5.1 which doesn't support a 64 bit build.
I have an app where first time I used PARSE. Then for second update, client requested GoogleMaps . When setup GMS, it said: " Choose your project, rather than a specific target, and open the Build Settings tab. In the Other Linker Flags section, add -ObjC. If these settings are not visible, change the filter in the Build Settings bar from Basic to All. "
If I set -ObjC to linker flags, I have this kind of errors from parse:
Undefined symbols for architecture i386: "_FBTokenInformationExpirationDateKey", referenced from:
-[PFFacebookTokenCachingStrategy cacheTokenInformation:] in Parse(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy expirationDate] in Parse(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setExpirationDate:] in Parse(PFFacebookTokenCachingStrategy.o)
"_FBTokenInformationTokenKey", referenced from:
-[PFFacebookTokenCachingStrategy accessToken] in Parse(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setAccessToken:] in Parse(PFFacebookTokenCachingStrategy.o)
"_FBTokenInformationUserFBIDKey", referenced from:
-[PFFacebookTokenCachingStrategy facebookId] in Parse(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setFacebookId:] in Parse(PFFacebookTokenCachingStrategy.o)
"OBJC_CLASS$_FBAppCall", referenced from:
objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
"OBJC_CLASS$_FBRequest", referenced from:
objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
"OBJC_CLASS$_FBSession", referenced from:
objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
"OBJC_CLASS$_FBSessionTokenCachingStrategy", referenced from:
_OBJC_CLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o)
"OBJC_METACLASS$_FBSessionTokenCachingStrategy", referenced from:
_OBJC_METACLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o)
ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I found a solution to do not add Facebook in app and to use this kind of flag: -force_load
And after using this, I have also error: ld: file not found: clang: error: linker command failed with exit code 1 (use -v to see invocation)
I tried different types of using this, like : -force_load - the same error -force_load pathOfFramework/ - the same error
It is possible to give me a solution for this ?
Thanks a lot !
The problem is that parse has classes that it doesn't load if it doesn't need. For example, it only imports the Facebook classes if FacebookSDK is installed. -ObjC loads all of these, but they are dependent on FacebookSDK. When it can't find the files it needs, it throws errors:
Change:
-ObjC
To:
-force_load $(PROJECT_DIR)/GoogleMaps.framework/GoogleMaps
Source: Here
So On the simulator It works all perfect. No errors, nothing
Now I want to put it on my iPod and I get some unknow errors and I dont't know how to fix them.
-I have the MediaPlayer.framework and it is included in my build
Here is the error:
ld: warning: ignoring file /Users/NAME/Desktop/XCode/PROJECT/MediaPlayer.framework/MediaPlayer, file was built for unsupported file format which is not the architecture being linked (armv7)
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_MPMoviePlayerViewController", referenced from:
objc-class-ref in MoviePlayViewController.o
"_MPMoviePlayerDidEnterFullscreenNotification", referenced from:
-[MoviePlayViewController viewDidLoad] in MoviePlayViewController.o
"_MPMoviePlayerWillExitFullscreenNotification", referenced from:
-[MoviePlayViewController viewDidLoad] in MoviePlayViewController.o
"_MPMoviePlayerPlaybackDidFinishNotification", referenced from:
-[MoviePlayViewController viewDidLoad] in MoviePlayViewController.o
"_MPMoviePlayerPlaybackDidFinishReasonUserInfoKey", referenced from:
-[MoviePlayViewController playbackFinished:] in MoviePlayViewController.o
"_MPMoviePlayerWillEnterFullscreenNotification", referenced from:
-[MoviePlayViewController viewDidLoad] in MoviePlayViewController.o
"_MPMoviePlayerDidExitFullscreenNotification", referenced from:
-[MoviePlayViewController viewDidLoad] in MoviePlayViewController.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 tell me what the error means and what I have to check? :)
Thanks
The only thing whcih is understandable for me is: unsupported file format.
It can't find the MediaPlayer.framework I believe is the problem. You need to update your Library Header Search Path in the build settings. It is looking for it on your desktop I believe.
You may need to add it to your target, relink it, or just make sure its pointing in the correct place.