discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking frameworks does not work


From: Andreas Höschler
Subject: Re: Linking frameworks does not work
Date: Wed, 2 May 2018 17:10:16 +0200

Hi Wolfgang,

  [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.

Thanks a lot. I added

   [SRMailDelivery sendMailFrom:@"asas" to:@"asas" subject:@"asas" body:@"asas" attachmentsAndFilenames:nil];

to the code and this indeed forced SRFoundation to be linked in. The execption happens now later when trying to call a category method of just another framework. 

This is indeed painful and annoying and has not always been that way in the past, not on Solaris with GNUstep make and also not on Debian and Kubuntu and definitely not on MacOSX. 

Does this mean that I have to define a dummy class in each framework and include calls to these dummy classes for every 12 frameworks I have in use at app launch? How annoying and dirty is that? :-( There is no cleaner solution?

Best wishes,

 Andreas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]