views:

64

answers:

2

I have to compile one executable on Windows, the first time. I'm using visual studio 2003 and want the equivalent of a command line macro definition.

What's the VS equivalent of g++ -Dthismacro=1?

Update For VS 2003, I found it this way. Right clicking on the project, I go to "Properties". From there, it's Configuration Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions

+2  A: 

If you right click on the project, it should bring up a project configuration page. Goto "build" and then you should be able to define preprocessor symbols.. (hopefully it works the same in 2003 as 2008)

Earlz
+4  A: 

since you seem to be coming from a linux-flavor, why not use the commandline: the argument for macro definition is actually the same, except the compiler executable is cl and not g++:

cl -Dthismacro=1

although the documentation says the convention is to use /D, most (all?) arguments can be used with the - switch.

When using visual Studio, you can verify this: if you add a preprocessor symbol the way earlz suggested, this can be seen as /D"thismacro=1" option under Configuration->C/C++->Command Line

stijn