delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/20/18:47:43

From: "DeHackEd" <Not DOT given AT out>
References: <Pine DOT GSO DOT 3 DOT 96 DOT 980420182958 DOT 22701A-100000 AT ural2>
Subject: Re: Build number
Date: Mon, 20 Apr 1998 18:42:21 -0400
Lines: 30
Message-ID: <#2k7K2Kb9GA.363@upnetnews03>
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

There are Preprocessor commands that do these things. This is more of a C
problem then a DJGPP problem... Try this out...


#include <stdio.h>
#define VERSION 100 // 1.00 for the heck of it

int main()
{
    printf("Compiled at %s on %s\n", __TIME__, __DATE__);
    printf("Pretend error: variable d < 0 line %d\n", __LINE__);
}


You could have VERSION a command-line variable with the -D option and makefile
could specify a version of your program would accept. RHIDE could do it, though
I don't have exact instructions.

--
"DeHackEd"

EMail address not given out due to low-life spammers.
Dervarics Mate wrote in message ...
>Is there any method to compile the build number into the exe file? Like
>you can include the date and the version of the compiler in your program?
>Is it compiler or IDE specific? (I use DFE and RHIDE)
>                                                        Greg
>


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019