• 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: Using agvtool's generated version info file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using agvtool's generated version info file?


  • Subject: Re: Using agvtool's generated version info file?
  • From: Rainer Brockerhoff <email@hidden>
  • Date: Mon, 16 Aug 2010 08:35:58 -0300

At 03:04 -0700 16/08/10, email@hidden wrote:
>From: Christiaan Hofman <email@hidden>
>References: <email@hidden>
>In-Reply-To: <email@hidden>
>Date: Mon, 16 Aug 2010 12:03:17 +0200
>Message-ID: <email@hidden>
>
>On Aug 16, 2010, at 11:47, Nicholas Helke wrote:
> > I'm relatively new to agvtool. I've got everything working the way I want, except:
>>
> > I'm trying to figure out how best to include the generated VERSION_INFO_FILE (Located at build/$(PRODUCT_NAME).build/$(ACTIVE_CONFIGURATION)/$(PRODUCT_NAME).build/DerivedSources/$(PRODUCT_NAME)_vers.c) in my Xcode project so I can access the two constants it sets.
> > Nicholas Helke
>
>You should never have to access that file explicitly, Apple's code does that implicitly. If you need the version number in your code you should get it from the info dictionary from the mainBundle.

Not quite. (And the version string isn't in the info dictionary, too.)

If you look at that file it's something like this:
	const unsigned char XYZVersionString[] __attribute__ ((used)) = "@(#)PROGRAM:XYZ  PROJECT:XYZ-101" "\n";
	const double XYZVersionNumber __attribute__ ((used)) = (double)101.;
where "XYZ" is your project name, and 101 your version.

So you can access those constants by including
	extern const unsigned char XYZVersionString[];
	extern const double XYZVersionNumber;
in the file where you want to access them, and the linker will find them for you.

HTH,
--
Rainer Brockerhoff  <email@hidden>
Belo Horizonte, Brazil
"In the affairs of others even fools are wise
 In their own business even sages err."
Blog: http://brockerhoff.net/blog
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Using agvtool's generated version info file?
      • From: Christiaan Hofman <email@hidden>
  • Prev by Date: Re: NSMutableArray count causes EXC_BAD_ACCESS
  • Next by Date: Re: Using agvtool's generated version info file?
  • Previous by thread: Re: Using agvtool's generated version info file?
  • Next by thread: Re: Using agvtool's generated version info file?
  • Index(es):
    • Date
    • Thread