Is there a way to add extra preprocessor #define in devenv command line?
+2
A:
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
HakonB
2009-11-23 13:44:09
I had in mind devenv.exe. cl only compiles IIRC. devenv does linking as well.
Paulius Liekis
2009-11-23 13:59:24
That works fine - I just found the same answer somewhere else. Thanks anyway!
Paulius Liekis
2009-11-23 15:05:08
Well, then you should accept the answer so others can see that this question is solved...
HakonB
2009-11-23 15:23:55
A:
right click on the project goto C++/preprocessor preprocessor Definitions
rerun
2009-11-23 13:45:47
I need to do it from a command line. I don't want to modify project settings or create extra configuration.
Paulius Liekis
2009-11-23 13:56:32
A:
The #defines are defined in your Visual Studio project file (.dsp or .vcproj file). This is a simple text file. So you could edit the project file from a script, then call devenv.exe.
user9876
2009-11-23 14:18:43