Get current program version

This is a discussion on Get current program version within the C++ Programming forums, part of the General Programming Boards category; Is there some kind of preprocessor directive or macro that gives me the current version (major/minor/build/release) of the program?...

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    85

    Get current program version

    Is there some kind of preprocessor directive or macro that gives me the current version (major/minor/build/release) of the program?

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    This is C++. Do it yourself. lol.

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    85
    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.

  4. #4
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    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).

  5. #5
    Registered User
    Join Date
    Aug 2007
    Posts
    85
    Hmm, so there is no standard way..

  6. #6
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    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.

  7. #7
    Registered User
    Join Date
    Jan 2005
    Posts
    7,318
    >> my IDE autoincrements the build
    Which IDE?

  8. #8
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,231
    because my IDE autoincrements
    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_.
    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

  9. #9
    Registered User
    Join Date
    Jan 2005
    Posts
    7,318
    "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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program Plan
    By Programmer_P in forum C++ Programming
    Replies: 0
    Last Post: 05-11-2009, 01:42 AM
  2. deleting a node in linked list
    By BoneXXX in forum C Programming
    Replies: 18
    Last Post: 12-17-2007, 11:30 AM
  3. insufficient memory for tsr
    By manmohan in forum C Programming
    Replies: 8
    Last Post: 01-02-2004, 08:48 AM
  4. HelpMePlease
    By Prncess100 in forum C++ Programming
    Replies: 6
    Last Post: 12-11-2002, 01:02 PM
  5. My frist program Omhs law
    By Mac_thevamp in forum C Programming
    Replies: 7
    Last Post: 10-04-2002, 04:55 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21