how do I add preprocessor #define in devenv command line?

Paulius Liekis picture Paulius Liekis · Nov 23, 2009 · Viewed 9.5k times · Source

Is there a way to add extra preprocessor #define in devenv command line?

Answer

HakonB picture HakonB · Nov 23, 2009

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