Is there some kind of preprocessor directive or macro that gives me the current version (major/minor/build/release) of the program?
Is there some kind of preprocessor directive or macro that gives me the current version (major/minor/build/release) of the program?
Neah, because my IDE autoincrements the build and.. and.. [hmm, thinks of a silly reason].. and I want to see the build number every time I run the program! :P
If I simply wrote that in a preprocessor define, it wouldn't be fun.
So RTM with regard to your IDE/compiler and see if they support a way to get it from a preprocessor define or something (which is where they might store it).
Hmm, so there is no standard way..
No. There's no such thing as a version # in a C++ program with regard to the program itself. That's just an abstract idea made up by programmers to keep track of their programs.
TBH, you don't even have to keep the standard you suggested, with major and minor build versions.
>> my IDE autoincrements the build
Which IDE?
I think it is incremental linking. A C++ program does not have a version in its executive, does it? If it has, it should be accessible like _TIME_ or _LINE_.because my IDE autoincrements
Last edited by siavoshkc; 08-15-2007 at 01:02 PM.
Learn C++ (C++ Books, C Books, FAQ, Forum Search)
Code painter latest version on sourceforge DOWNLOAD NOW!
Download FSB Data Integrity Tester.
Siavosh K C
"Auto-increment" means to automatically increase the build number by one for each build. "Incremental linking" means re-linking only those object files that have changed. They are unrelated, despite the term "increment" being in both of them.
Some IDEs (or at least VC++) can store version and buildnumber information in the resource file for the application.