Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a string preprocessor definition from command-line in VC 2005 (C++)?

The documentation tells me that /D command-line switch can be used to do this, like so:

  CL /DDEBUG TEST.C

would define a DEBUG symbol, and

  CL /DDEBUG=2 TEST.C

would give it the value 2. But what do I do if I would like to get the equivalent of a string define, such as

  #define DEBUG "abc"

?

like image 909
MaxVT Avatar asked Dec 13 '22 02:12

MaxVT


1 Answers

Due to the way command line is parsed in Windows, you'll have to escape the quotes.

CL /DDEBUG=\"abc\" TEST.C
like image 121
avakar Avatar answered May 19 '23 08:05

avakar