Its been a while since I wrapped my little noggin around this issue but perhaps this will help:
https://github.com/mugginsoft/Single-Object-Prelink-Framework-Demo <https://github.com/mugginsoft/Single-Object-Prelink-Framework-Demo> There is a thread too, but the Apple list server seems to be on the beer again: https://lists.apple.com/archives/xcode-users/2014/Apr/msg00079.html <https://lists.apple.com/archives/xcode-users/2014/Apr/msg00079.html> Jonathan > On 6 Feb 2017, at 22:04, Mr steve davis <southwestmons...@googlemail.com> > wrote: > > > I would be so grateful if someone could help me, I have been banging my head > a against a brick wall for days on this now. > Here’s a sample project if it helps… > http://www.thingsidoatwork.co.uk/MyProject.zip > <http://www.thingsidoatwork.co.uk/MyProject.zip> > > I'm creating a Framework wrapper round a static library. The header > (MyLibrary.h) needs to be accessable from the ViewController.m file in > MyProject > > MyProject > MyFramework > MyLibrary.h > libMyLibrary.a > > > > #import "ViewController.h" > @import MyFramework; > > @implementation ViewController > > - (void)viewDidLoad { > [super viewDidLoad]; > > [[[MyLibrary alloc]init]test]; > } > > > I have set MyLibrary.h to public > MyFramework.h contains the line #import <MyFramework/MyLibrary.h> > 'Embedded Binaries' is set to MyFramework > When I run the above code I get... > > > Undefined symbols for architecture x86_64: > "_OBJC_CLASS_$_MyLibrary", referenced from: > objc-class-ref in ViewController.o > ld: symbol(s) not found for architecture x86_64 > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > > > The only way I have found to solve this problem is to create a private Class > in MyFramework (called TestClass) and allocate MyLibrary. I assume this > forces MyLibrary to be linked at runtime and accessable from ViewController. > But this is ugly as hell, what am I missing? > > #import "TestClass.h" > #import "MyLibrary.h" > > @implementation TestClass > - (id)init { > if (self = [super init]) { > > [MyLibrary alloc]; //solves the problem of MyLibrary being accessable > from ViewController > } > return self; > } > @end > > > Is there a compiler flag I’m missing that would help? I have tried all-load > -ObjC etc but no luck. > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/lists%40mugginsoft.com > > This email sent to li...@mugginsoft.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com