Re: linking error
Re: linking error
- Subject: Re: linking error
- From: Alexander Spohr <email@hidden>
- Date: Thu, 25 Jun 2009 11:44:56 +0200
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 (email@hidden)
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:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden