Questions tagged [weak-linking]

73 questions
0
votes
1 answer

Getting the address of a overwritten weak symbol

My question assumes gcc or clang for x86 or x86_64. Let's say I have the following files: // weak.c #include __attribute__((weak)) void i_am_weak(void) { printf("I am weak\n"); } int main() { i_am_weak(); return 0; } //…
icebp
  • 1,350
  • 1
  • 13
  • 21
0
votes
1 answer

Can you weak link(optional link) a static library in C++ like Objc could?

I am developing a static library A with a mix of Objective C and C++ in Xcode, I run into the need to "weak link" another static library and Let's call it B. A calls some methods defined in B. The idea is that if B is not linked/provided, A will not…
zfgo
  • 143
  • 8
0
votes
1 answer

Weak linking in static library iOS

We have a static framework that we have built and it depends upon an SDK that we use to access ID's. This SDK has come out with a new version which has a new interface. Currently the user would add our framework and the dependency SDK and…
user3440639
  • 169
  • 2
  • 11
0
votes
0 answers

How to see which functions are weak-linked in an object?

Is there a way to see/capture weakly linked functions in an object? I removed older library's linkage but since some are linked with weak-linkage, I can't capture all of the used functions.
Mert Can Ergün
  • 241
  • 5
  • 14
0
votes
3 answers

weak linking in shared object not working as expected

I'm trying to use the cmocka unit test framework which suggests to use weak linking to be able to select a user-defined implementation over the actual implementation of a function. In my environment I have a shared object which I want to unit test.…
Thanos
  • 641
  • 1
  • 5
  • 13
0
votes
1 answer

Checking for the existence of externally defined identifiers in C

I ran into this problem while developing in Objective-C for iOS, but this should apply to any C/C++/Objective-C code using the Mac OS X/iOS linker. The solution is covered by another question, but I'm interested in the why. Let's say I'm using a…
benzado
  • 74,658
  • 20
  • 105
  • 133
0
votes
1 answer

Weak linked class in Xcode

My project has an Objective-C class MockupModel that provides mockup information to an iOS Xcode project to help with creating screen shots for the App store. The project has two targets. The mockup target includes MockupModel.m. I want the main…
Benjohn
  • 12,147
  • 8
  • 58
  • 110
0
votes
1 answer

Only weak link the frameworks which is not available in deployment target?

In my app, Most frameworks is weak linked. As I read the document, I consider that maybe I needn't weak-link these frameworks. Setting of my app My app's deployment target is iOS4.3 and the base SDK is iOS7.1. My idea In my app I use CIImage and…
KudoCC
  • 6,722
  • 1
  • 21
  • 48
0
votes
1 answer

Error when weak-linking StoreKit framework on iPhone

I am trying to add In App Purchase support to my app. I would like the app to still be able to support OS2.2.1, but IAP are not available unless the OS version is 3.0 or higher. I have tried weak-linking the StoreKit framework. Basically, I have…
CG.
  • 1
  • 1
0
votes
2 answers

Objective-C Check if Structs is defined

My iOS application can use an optional external 3rd party library. I thought of using this answer (Weak Linking - check if a class exists and use that class) and detect if the class exists before executing code specific to this library. However, I…
Nathan H
  • 44,105
  • 54
  • 154
  • 235
0
votes
0 answers

Conditional weak-linked symbol modification/redeclaration

I have the following weakly linked declaration: extern __attribute__((visibility ("default"))) Type* const symbolName __attribute__((weak_import)); The problem is, the symbol may or may not be defined, depending on the operating system. So, when I…
Leo Natan
  • 55,734
  • 8
  • 140
  • 186
0
votes
2 answers

Can you inherit from a class in objc not available at compile time?

I have code inheriting from UIActivity introduced in iOS 6 which compiles fines with Xcode 4.5 and works fine on iOS 6 and previous versions (I detect availability of the class at runtime). However, is it possible to make this code compile with…
Grzegorz Adam Hankiewicz
  • 6,238
  • 1
  • 30
  • 65
0
votes
1 answer

Weak linking popoverBackgroundViewClass to make it work in <5.0 IOS

Already checked this question: Weak linking UIPopoverBackgroundView and already read: http://www.marco.org/2010/11/22/supporting-older-versions-of-ios-while-using-new-apis#fnref:1 I have a custom PopoverBackgroundView declared in a .h and…
pdrcabrod
  • 1,467
  • 1
  • 14
  • 22
1 2 3 4
5