[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Linking frameworks does not work
From: |
Wolfgang Lux |
Subject: |
Re: Linking frameworks does not work |
Date: |
Wed, 2 May 2018 16:21:44 +0200 |
> Am 02.05.2018 um 15:45 schrieb Andreas Höschler <ahoesch@smartsoft.de>:
>
> Hi Wolfgang,
>
>> On 2. May 2018, at 15:36, Wolfgang Lux <wolfgang.lux@gmail.com> wrote:
>>
>> Selectors do not count here. They are only resolved at runtime not a link
>> time.
>> You would need an explicit reference to a class, function or global variable
>> from your frameworks inside the code of the test application to have the
>> linker include those libraries in the executable.
>
> int main (int argc, const char **argv, char** env)
> {
> NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
>
> [NSApplication sharedApplication];
>
> controller = [[Controller alloc] init];
> NSLog(@"controller %@", controller);
> [NSApp setDelegate:controller];
>
> [NSString stringByChaining:@"ass" count:3];
>
> ...
>
> [pool release];
>
> return NSApplicationMain (argc, argv);
> }
>
> Is this directly enough?
No.
> The method NSString::stringByChaining:count:] is defined/implemented in my
> SRFoundation framework.
True. But when looking for a reference to resolve the NSString class, the
linker is stubbornly looking for the class definition itself (which is found in
gnustep-base) and not for any categories defined for that class. Indeed it can
be fairly painful to get categories linked from frameworks/libraries into an
executable. You really need a class implementation and not a category (or a
global variable or function) to enforce linking.
Wolfgang
- Linking frameworks does not work, Andreas Höschler, 2018/05/02
- Re: Linking frameworks does not work, Wolfgang Lux, 2018/05/02
- Re: Linking frameworks does not work, Andreas Höschler, 2018/05/02
- Re: Linking frameworks does not work, Wolfgang Lux, 2018/05/02
- Re: Linking frameworks does not work, Andreas Höschler, 2018/05/02
- Re: Linking frameworks does not work, Andreas Fink, 2018/05/02
- Re: Linking frameworks does not work, Andreas Höschler, 2018/05/02
- Re: Linking frameworks does not work, Andreas Fink, 2018/05/02
- Re: Linking frameworks does not work, Andreas Höschler, 2018/05/02
- Re: Linking frameworks does not work,
Wolfgang Lux <=
- Re: Linking frameworks does not work, Andreas Höschler, 2018/05/02
- Re: Linking frameworks does not work, Richard Frith-Macdonald, 2018/05/02
- Re: Linking frameworks does not work, Wolfgang Lux, 2018/05/06
- Re: Linking frameworks does not work, Andreas Höschler, 2018/05/02
Re: Linking frameworks does not work, Andreas Höschler, 2018/05/02