Re: Multiple targets, multiple definitions of symbol
Re: Multiple targets, multiple definitions of symbol
- Subject: Re: Multiple targets, multiple definitions of symbol
- From: Camillo Lugaresi <email@hidden>
- Date: Thu, 5 Jan 2006 11:57:13 +0100
On 05/gen/06, at 11:01, Joachim wrote:
I have an Xcode project with two targets. One is included in the
other. They share some code, amongst others a header file with a
bunch of NSDictionary keys defined as NSString pointers. When the
compiler links the last target (that includes the first), I get
"multiple definitions of symbol xyz" for all the NSString* constants.
Don't define globals in a header file, or you will have a definition
for each implementation file that includes the header. Declare them
in a header, and define them in one single implementation file.
globals.h:
extern NSString *const MyDictionaryKey;
globals.m:
NSString *const MyDictionaryKey = @"mykey";
Camillo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden