Need Help: Linking Error with Mail Plugin
Adam Nash
adamnash at cs.stanford.edu
Sat Sep 15 16:39:08 PDT 2007
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
More information about the MacOSX-dev
mailing list