Archived

This topic is now archived and is closed to further replies.

Build and Build Date

This topic is 4946 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m looking for a way to report the build number, and the build date of the dll/programs loaded. Is there any easy way to do this -- I wasn''t sure if MSVC++ 6.0 did that automatically (atleast, I couldn''t find any way of seeing so). If someone has an answer, please, it would be very appreciated. I want to be able to stamp my engine DLLs with build numbers, and build dates/times. Thanks, -John "bkt" Bellone Flipside Software FlipEngine!

Share this post


Link to post
Share on other sites
You can a version information resource (in the same manner as any other standard resource type) in MSVC 6. I don''t think the IDE has any method to automatically increment the build version automatically. (Though I could be wrong on that count. Most projects that I''ve been on that actually track build numbers use an independent build process.)

You can also use the /VERSION linker flag, though that probably doesn''t do what you expect.

Share this post


Link to post
Share on other sites
Here's a hacky trick I used once to get automatic build numbers in MSVC:
Create a file that looks like this:

#define BUILDNUMBER 0

Create a file in your favorite scripting language (or just use C/c++) that reads in the file, extracts the number, increments it and writes it back out. I used python:

file=open('build.h','r')
line=file.readline().split(' ')
num=int(line[2])+1
file.close()
file=open('build.h','w')
file.write('#define BUILDNUMBER %i\n' % num)
file.close()

Now add that script to post-build step (in project settings)
just #include 'build.h' when you need the buildnumber.

Whenever you build your project, it changes the file, so next time you build it'll get updated.
(One slight problem with this is since build.h is always modified, MSVC++ will always want to rebuild when you try to run the project. (just say no)
It shouldn't be too hard to expand this to do date as well.


[edited by - TravisWells on May 27, 2004 11:18:48 PM]

Share this post


Link to post
Share on other sites
I actually use the Win32 resources to do something similiar so I can distinguish between release and internal bulds. In VC++ 6 You can create a VERSION resource, fill in the blanks such as version, copyright trademarks etc. and just compile it - no additional flags or code required. Also, the information you enter will stamped in header block of your exe or DLL meaning that it will show up when someone does a right click->properies from a file explorer window. To automatate it, the perl script idea mentioned before sounds good.

Share this post


Link to post
Share on other sites