I'm trying to develop a simple ios tweak that uses some springboard components. I've dumped the headers and included the one I need (SBLockScreenNotificationScrollView.h), but when I compile I get a linker error:
Undefined symbols for architecture armv7s:
"_OBJC_CLASS_$_SBLockScreenNotificationScrollView", referenced from:
objc-class-ref in NotificationSwipe.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've tried copying the SpringBoard binary from phone and adding it under Link Binary with Libraries in xcode. Thanks for the help.
When you don't have class implementation or library it defined in you have to obtain the class at runtime. This is what objc_getClass function is for. It returns an objc class at runtime and gives you the ability to use the class without knowing anything about him at compile-time.
Just replace SBLockScreenNotificationScrollView with objc_getClass("SBLockScreenNotificationScrollView").
I suggest you read about objective-C runtime. Developing tweaks requires you to understand at least basics in which case you wouldn't ask this kind of questions.
Related
Hi i'm trying to integrate BoldChat framework into IOS react native project.
After integrating via following steps
Project target -Build Phases - Link binary with libraries - Plus
button - framework
While trying to build, im getting below error
Undefined symbols for architecture x86_64:
"_utf8_nextCharSafeBody", referenced from:
-[BC_SRWebSocket _innerPumpScanner] in VisitorSDK
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I tried removing ,re-adding framework , it's not working.
Even tried creating new project and integrating , still error is same.
please let me know how to resolve this. I have even tried similar stack overflow answers, still error exists.
In most cases this points to one or more missing references to frameworks in the section Linked Frameworks And Libraries in the Targets settings of the app in Xcode.
To find out which framework reference should be added:
Right-click on the error in the build time errors
list Choose 'Reveal in Log',
Search in the log for 'Undefined symbols for architecture x86_64'
A list of undefined 'symbols' (mostly class methods and properties)
is displayed
To find out which framework reference should be added, select such
undefined symbol, right-click and choose Search with Google
In most cases you'll end up in the documentation of Apple, which
should give a clue about the related framework
Add the framework in the section Linked Frameworks And Libraries by
clicking on the + button.
Build the app.
If necessary, repeat this procedure for remaining undefined
'symbols'.
In my case libucucore.tbd is missing . Added that and error is gone.
I'm getting this error:
Undefined symbols for architecture x86_64:
"_hmac_sha1", referenced from:
-[OAHMAC_SHA1SignatureProvider signClearText:withSecret:] in OAHMAC_SHA1SignatureProvider.o
"_Base64EncodeData", referenced from:
-[OAHMAC_SHA1SignatureProvider signClearText:withSecret:] in OAHMAC_SHA1SignatureProvider.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is the line is complaining about:
extern void hmac_sha1(const u_int8_t *inText, size_t inTextLength, u_int8_t* inKey, const size_t inKeyLength, u_int8_t *outDigest);
I can not figure what is wrong or how can I fix this issue.
I'll really appreciate your help.
Looks like you are missing a library or framework. Select your Project in the project navigator, go to the General tab, and scroll down to Linked frameworks and libraries. Click the + symbol to add a framework or library to your project.
hmac_sha1 is part of the Common Crypto library, so that looks like a good place to start.
From my personal experience, these clang errors are a bit general. Most often I see these when I get naming collisions. Most recently I updated a framework to its newer version, and ended up getting both a class name collision and an extern NSString * const, which from what you said above could likely be your problem. I'd do a search for "hmac_sha1" in your codebase and see what shows up. Maybe even change the name and run it again.
Until the most recent upgrade I could debug on a device. I now get the following errors:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_ZipArchiveDelegate", referenced from:
objc-class-ref in registrar.armv7.o
_OBJC_CLASS_$_MiniZip_ZipArchive_ZipArchive__ZipArchiveDelegate in registrar.armv7.o
"_OBJC_METACLASS_$_ZipArchiveDelegate", referenced from:
_OBJC_METACLASS_$_MiniZip_ZipArchive_ZipArchive__ZipArchiveDelegate in registrar.armv7.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error MT5211: Native linking failed, undefined Objective-C class: _OBJC_CLASS_$_ZipArchiveDelegate. If '_OBJC_CLASS_$_ZipArchiveDelegate' is a protocol from a third-party binding, please check that it has the [Protocol] attribute in its api definition file, otherwise verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
error MT5210: Native linking failed, undefined symbol: _OBJC_METACLASS_$_ZipArchiveDelegate. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
error MT5202: Native linking failed. Please review the build log.
I've cleaned, and rebuilt but with no avail. Any ideas?
It turns out this error is caused by the improved strictness of the new default static registrar:
http://docs.xamarin.com/releases/ios/xamarin.ios_7/xamarin.ios_7.2/#1
http://docs.xamarin.com/guides/ios/advanced_topics/registrar/#Protocols_must_have_the_Protocol_attribute
You can work around the problem temporarily by requesting that Xamarin.iOS use the legacy registrar. To do this, add "--registrar:legacy" under "Project Options -> iOS Build -> Additional mtouch arguments".
The components team has also contacted the authors of the ZipArchive component to let them know about the issues with the new registrar, but they have not yet replied. In case the they do not provide an update soon, you can look at transitioning to an open-source binding for the same library written by the Xamarin components team [1]. One caution with this binding is that the method and class names might be different from the ones in the ZipArchive component, and the namespaces are definitely different. So you will need to update the names in your app accordingly.
[1] https://github.com/mono/monotouch-bindings/tree/master/ZipArchive
Having the exact same issue. But both on zipArchive and SDWebImage.
Uninstalled-re-installed xamarin. Did not help.
Created a solution from scratch, added zipArchive and added to the using section.
The project does not build for device. But building for simulator is fine.
Emailed Xamarin support for help.
I just compiled a project and Xcode returns these two errors which don't seem to be my code's fault. How do I fix them?
Undefined symbols for architecture i386:
"_vImageBoxConvolve_ARGB8888", referenced from:
-[UIImage(Blur) boxblurImageWithBlur:] in UIImage+Blur.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Teaching a man (or women) how to fish:
Usually Mach-O Linker Error means you have not included a header file for a function you are using in your code.
Easiest way is to copy that function or method call and paste into Xcode quick search using shift+command+O. This will search all frameworks (and header files), find that function or method call and show you its location (the header in this case):
In this case, this call belongs to the Accelerate framework so on top of your file, enter:
#import <Accelerate/Accelerate.h>
When doing quick search, you might have to get rid of leading underscore. In other words, search for vImageBoxConvolve_ARGB8888
Hope this helps
Google is your friend: someone else fixed this by adding the Accelerate framework to their project (and this does look like a framework error).
https://github.com/rnystrom/RNBlurModalView/issues/5
Make sure you also have the QuartzCore framework included as well, as that is also required by that library.
Apparently vImageBoxConvolve_ARGB8888() is not defined. See if the Accelerate framework is properly included in the project.
My project uses some Cocoa static libraries, one of which is a Zxing Project. I am getting a lot of errors while trying to incorporate this project. Weirdly enough, I was able to create a demo with Zxing in a separate project, without any errors. My main project builds and runs ok, as long as I do not include the Cocoa static library for Zxing.
So the question is, how do I include the ZXing static library to my Cocoa project? How do I configure library (e.g. how do I set the Header Search Paths~~).
Thanks.
Some detail about my project
The Structure
EnjoyMobile
-CustomStaticLibrary.xcodeproj
-ZXingWidegt.xcodeproj
Header search Paths in my -CustomStaticLibrary Target
./zxing/iphone/ZXingWidget/Classes
./zxing/cpp/core/src
The error
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_QRCodeReader", referenced from:
objc-class-ref in libCustomerLibrary.a(CustomerViewController.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Zxing is kind of a painfull integration, also in the newer versions of Xcode Apple added more error checks. I would suggest you to use cococapods for a better integration or this ObjectiveC wrapper here
It's not seeing some of the lib classes. Double check the steps in the README, particularly step 2. If it still fails, post the link command that fails.