Is there a way to add extra preprocessor #define in devenv command line?
The #include directive tells the C preprocessor to include the contents of the file specified in the input stream to the compiler and then continue with the rest of the original file. For example, the header file, file.h contains the following: char *func (void);
The preprocessor is a program that sends the source code before it passes through the compiler. It operates under preprocessor directives which begin with the symbol #.
What Does Preprocessor Directive Mean? Preprocessor directives are lines included in a program that begin with the character #, which make them different from a typical source code text. They are invoked by the compiler to process some programs before compilation.
Examples of some preprocessor directives are: #include, #define, #ifndef etc. Remember that the # symbol only provides a path to the preprocessor, and a command such as include is processed by the preprocessor program. For example, #include will include extra code in your program.
I am not entirely sure what you mean by vcbuild command line but if you mean the Visual C++ command line compiler then you can add defines by add /Dxxxx, e.g.
cl.exe /DSHAREWARE ....
Additional answer based on comments:
You should be able to set the CL environment variable with the extra preprocessor define:
SET CL=/DSHAREWARE
devenv ....
Mere information can be found at MSDN
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With