Yes, I just realized that. Silly mistake.

Thanks for responding.
Wagner

On Jun 25, 2009, at 11:44 AM, Alexander Spohr wrote:

Each inclusion of your header somewhere creates a new global variable named someString.

Change it to have
extern NSString* const someString;
in SharedDefs.h and
NSString* const someString = @"foo";

in SharedDefs.m

If you have no SharedDefs.m just crete one ;)

        atze



Am 25.06.2009 um 10:44 schrieb WT:

Hello list,

I have a linking error that is puzzling me and I'd be grateful for some enlightenment.

In AppDelegate.h:

#import "SharedDefs.h"

In AppDelegate.m:

#import "AppDelegate.h"
#import "SomeClass.h"

In SomeClass.m:

#import "SomeClass.h"
#import "SharedDefs.h"

SharedDefs.h contains definitions (#define's, struct's and enum's) that are shared by several classes.

This works fine until I add

NSString* const someString = @"foo";

to SharedDefs.h, at which point I get a duplicate symbol linking error for _someString.

What gives?

Thanks in advance.
Wagner
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to