delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/08/11:57:29

Date: Wed, 8 Sep 1999 11:05:10 -0400
Message-Id: <199909081505.LAA20693@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <7r5npg$c9a$1@oravannahka.helsinki.fi> (message from Tuomo A
Turunen on 8 Sep 1999 13:19:44 GMT)
Subject: Re: Constant definitions to compiler
References: <7r5npg$c9a$1 AT oravannahka DOT helsinki DOT fi>
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Is it possible to give constant definitions to compiler as command line
> arguments? Something like this:
> 
> gcc (define OWN_CONSTANT "testing") test.c -o test.exe
> 
> and the OWN_CONSTANT would be replaced with "testing" string in test.c
> source code file. How is this possible?

Try this:

gcc -DOWN_CONSTANT='"testing"' test.c -o test.exe

- Raw text -


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