• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: linking error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linking error


  • Subject: Re: linking error
  • From: WT <email@hidden>
  • Date: Thu, 25 Jun 2009 11:52:09 +0200

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 (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


References: 
 >linking error (From: WT <email@hidden>)
 >Re: linking error (From: Alexander Spohr <email@hidden>)

  • Prev by Date: Re: linking error
  • Next by Date: Search in ABPeoplePickerView not working
  • Previous by thread: Re: linking error
  • Next by thread: Search in ABPeoplePickerView not working
  • Index(es):
    • Date
    • Thread