Reputation: 31
#ifdef DEBUG_TEST
std::cout << "Hello" << std::endl;
#endif
How can I #define DEBUG_TEST
as a command line argument in VS? I have tried /DDEBUG_TEST
and the directive does not get defined.
Upvotes: 0
Views: 926
Reputation: 44288
not sure if its a formatting problem in your question, but this should work :-
/D "DEBUG_TEST"
or enter it in the preprocessor section
Upvotes: 1
Reputation: 4339
The answer is:
/DDEBUG_TEST
No space, no quotation marks. I believe you can also use gcc syntax with cl, but I'm not sure. If so, this should also work:
-DDEBUG_TEST
Example usage:
cl /DDEBUG_TEST source_code.cpp
Here's the official documentation: https://msdn.microsoft.com/en-us/library/hhzbb5c8.aspx
Upvotes: 0