I added PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions!) and I got the 9 linking errors that I feel like many people have gotten before.
First time working with Facebook in an app and I added every framework, the header, and filled in the info.plist
I had to unwrap launchOptions so can someone help me out on how to get rid of these Mach-O Linker errors.
Updated with error log
ld: warning: directory not found for option '-F(1)'
ld: warning: Auto-Linking supplied '/Users/fabricemulumba/Documents/FacebookSDK/FBSDKShareKit.framework/FBSDKShareKit', framework linker option at /Users/fabricemulumba/Documents/FacebookSDK/FBSDKShareKit.framework/FBSDKShareKit is not a dylib
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_PFFacebookUtils", referenced from:
__TMaCSo15PFFacebookUtils in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Maybe you are using the old version of the Facebook's framework? I've just checked the library out that it does not have
ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) class.
To check that you could use
otool -L ParseFacebookUtilsV4.framework/ParseFacebookUtilsV4 -arch arm64
or
otool -L libParseFacebookUtilsV4Lib.a -arch arm64
the output will be like this
libParseFacebookUtilsV4Lib.a(PFFacebookUtils.o):
libParseFacebookUtilsV4Lib.a(PFFacebookAuthenticationProvider.o):
and I've checked out all dependencies libraries they also dont have any FBRequest and FBSession classes.
Try to use newest versions of sdk or link dependencies by CocoaPods.
Related
Error occurs after adding the ParseFacebookUtil
ERROR MESSAGE
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_PFDateFormatter", referenced from:
objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
FRAMEWORKS
I am using XCode 6.2
Thanks
edit:
I've added the frameworks social, and accounts. Same error still occurs.
I ended up fixing this issue by deleting the Parse and Bolts framework, and re adding it back into the project.
Edit:
The best solution to this issue is by using cocoapods. It handles the dependencies better than manually dragging in the framework files.
I have a project that uses CocoaPods. It was working but something got broken.
It does compile if I target the simulator, but If I target the devise (Build or Archive) it throws a linker error.
ld: warning: ignoring file /Users/myuser/ios/share/share/libPods.a, file was built for archive which is not the architecture being linked (armv7s): /Users/myuser/ios/share/share/libPods.a
Undefined symbols for architecture armv7s:
"_OBJC_CLASS_$_AFHTTPRequestOperationManager", referenced from:
objc-class-ref in BackendProxy.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I really need some help because I am really stucked.
Thanks!
EDIT: i deleted that libPods.a, that was an old one, and now it's giving me:
ld: library not found for -lPods
But only on Archive or Build for iosDevice, this is still working on the simulator.
Try removing armv7s from valid architectures section.
Build Settings -> Architectures -> Valid Architectures
I have followed this tutorial LINK
but i get a linker error when i added the lib and its .h to the project.
i searched google and i found that -ObjC and -all_load should be addd in setting i did it but the error couldn't be solved.The error is as follows:
ld: warning: ignoring file /Users/techvedika/Desktop/RND/MathTest/MathTest/iCodeBlogsMathLibrary/libICodeMathUtils.a, missing required architecture i386 in file /Users/techvedika/Desktop/RND/MathTest/MathTest/iCodeBlogsMathLibrary/libICodeMathUtils.a (3 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MathFunctions", 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 do i solve this?
Can you please check lipo -info libICodeMathUtils.a on terminal. If it is not listing architecture i386 that means your library is not build for simulator. And it will not work on simulator
obviously, this is not a crash , it's just a link error, your project lack of i386 version libICodeMathUtils.a, so you should first add libICodeMathUtils.a to your project.
The MathFunctions class is missing. Either from your application project or from the SimpleLibrary.a that you use. Make sure it is part of the compilation and linking steps of your build.
I'm using echoprint API for song search from last 3 months. But suddenly it started giving me below errors. Already I have face many problems while adding that API to my project & now it start giving me linker error. It was working for me previously.
Error like this:
"Codegen::Codegen(float const*, unsigned int, int)", referenced from: _GetPCMFromFile in File.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: symbol(s) not found for architecture i386
ld: warning: directory not found for option '-L-L/Users/prajaktakulkarni/Downloads/echoprint-codegen-4.12 2/src/echoprint-codegen-ios/build/Release-iphoneos'
ld: warning: ignoring file /Users/prajaktakulkarni/Documents/Instajam/libechoprint-codegen-ios.a, missing required architecture i386 in file /Users/prajaktakulkarni/Documents/Instajam/libechoprint-codegen-ios.a (2 slices)
Undefined symbols for architecture i386:
"Codegen::Codegen(float const*, unsigned int, int)", referenced from:
_GetPCMFromFile in File.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The error message is saying that the static library libechoprint-codegen-ios.a hasn't been built for the i386 architecture - which is the architecture used by the simulator.
You can find out which architectures the static library has been built for by running the following code in Terminal:
lipo -info ~/Documents/Instajam/libechoprint-codegen-ios.a
It will likely tell you it is built for armv7 and armv7s. That will support all but the oldest iOS devices at the time of writing.
You could build libechoprint-codegen-ios.a to run on a simulator. Here's a good stackoverflow post if you are interested in doing that: Build fat static library (device + simulator) using Xcode and SDK 4+
The easiest option would be to just plug your phone in and not worry about building a fat static library. :D
Recently the problem was fixed for me by using libz.1.1.3.tbd instead libz.tbd and of course this link is useful Echoprint iOS Missing Framework
I need to incorporate QR in my app, im using zxing,
the scan test works wonderfully, and when importing the widget after following all instructions, all goes fine,
but
I have this errors when implementing the code for the widget and QRCodeReader
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ZXingWidgetController", referenced from:
objc-class-ref in AttendanceVC.o
"_OBJC_CLASS_$_QRCodeReader", referenced from:
objc-class-ref in AttendanceVC.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
so how to fix this please?
edit:
my Architectures on build settings is: i386 armv6 armv7
thanks a lot!
Double check step 2 in the README. Under Link Binary with Libraries you must have libZXingWidget.a and it sounds like you don't.
Check the Valid Architectures in the build settings. Check out these links.
Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error
Undefined symbols for architecture i386
EDIT : Usually these type of linker errors occur due to the link issue in your compiler or link issue with your added frameworks or your libraries. check whether you are using a suitable compiler, check whether you have added all the required libraries and frameworks. Also check whether you have imported all the libraries and frameworks properly. Please check all these things too once. For guidance on this check the below links
http://forums.macrumors.com/showthread.php?t=956090
Apple Mach-O Linker Error when compiling for device
Linker error (only simulator) with own library after update to iPhone SDK 4.0
clang: error: linker command failed with exit code 1
Hope This Helps..
I had the same issue and following configuration in "Build Settings" works for me.
C Language Dialect: GNU99 [-std=gnu99]
C++ Language Dialect: Compiler Default
C++ Standard Library: Compiler Default