Need Help: Linking Error with Mail Plugin
Adam Nash
adamnash at cs.stanford.edu
Sat Sep 15 17:12:41 PDT 2007
Hi everyone,
Many thanks to Aaron Harnly for answering my question so quickly!
From his email:
There are two special settings you'll need in the 'Linking' section
of the bundle target's configuration:
1. in the field 'other linker flags', adding
-undefined dynamic_lookup
will resolve that issue.
2. As with any bundle, set the Bundle Loader to
/Applications/Mail.app/Contents/MacOS/Mail
- Adam
-----------
Adam Nash
adamnash at cs.stanford.edu
On Sep 15, 2007, at 4:39 PM, Adam Nash wrote:
> Hi everyone,
>
> After quite a few years of inactivity, I'm pursuing my first Mac OS
> X development project in quite a while. I'm writing a new Mail.app
> plugin, and I'm just trying to get started with the project work.
>
> Unfortunately, I'm not having much luck even building a simple
> "Hello, World" level bundle. It seems I'm hitting a linking
> error. I'm pretty sure there is a trivial answer to this issue,
> but I can't seem to figure it out.
>
> Basically, my application has just a single class right now with
> two headers:
>
> MVMailBundle.h
>
> This file uses the class-dump to specify the interface for the
> MVMailBundle class which is implemented by Mail.app
>
> MyMailBundle.h
>
> This file defines a subclass of MVMailBundle, implementing only the
> class method:
>
> + (void)initialize;
>
> MyMailBundle.m
>
> This file implements initialize as follows:
>
> #import "MyMailBundle.h"
>
> @implementation MyMailBundle
>
> + (void) initialize
> {
> [super initialize];
> [self registerBundle];
>
> NSLog(@"My Mail Bundle has registered with Apple Mail!");
> }
>
> @end
>
> When I try to compile this project, it works just fine, but it dies
> with a linking error:
>
> /usr/bin/ld: Undefined symbols:
> .objc_class_name_MVMailBundle
> /Users/adamnash/Documents/Cocoa/AdamMail/build/AdamMail.build/Debug/
> MyMail.build/Objects-normal/ppc/MyMailBundle.o reference to
> undefined .objc_class_name_MVMailBundle
> collect2: ld returned 1 exit status
>
> This makes sense, of course, since I don't actually have the object
> code for Mail.app in my project. I'm assuming there is some way to
> tell XCode to not look for this object code, but I'm not sure how
> to do this. I've never tried to implement a sub-class for
> something that only exists in an active application.
>
> Can someone help me with this linking error? I've been circling
> around it for over an hour with no luck. I feel like I've looked
> at every possible project setting.
>
> Thank you!
> Adam
>
> -----------
> Adam Nash
> adamnash at cs.stanford.edu
>
>
>
> _______________________________________________
> MacOSX-dev mailing list
> MacOSX-dev at omnigroup.com
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
>
More information about the MacOSX-dev
mailing list