all groups > visual studio .net general > july 2007 >
You're in the

visual studio .net general

group:

VS 2005 - Defining preprocessor macro from command line


VS 2005 - Defining preprocessor macro from command line Roland
7/17/2007 2:24:55 AM
visual studio .net general:
Hi All,
In my VC++ project, I have used a macro TEST

#ifdef TEST

// do this

#endif

I want to define or undef this macro from command line, I am using
DEVENV command to build the project. If I define it in Project
Properties under Preprocessor tab it works, How can I set it through
command line options ? Is there any way to do such kind of thing ?

Thanks,
Ajay
Re: VS 2005 - Defining preprocessor macro from command line nathan NO[at]SPAM visi.com
7/17/2007 4:47:38 PM
In article <1184664295.717540.293920@m37g2000prh.googlegroups.com>,
[quoted text, click to view]

First off, devenv, like most MS apps, will print out some usage
notes if you run it with /? on the commandline, e.g.:

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE>devenv /?

Next, see
http://msdn2.microsoft.com/en-us/library/xee0c8y7(VS.80).aspx for more
complete documentation. There ought to be a link from that page, but
http://msdn2.microsoft.com/en-us/library/kezkeayy(vs.80).aspx is what
you're looking for. If you do

set CL=/DTEST

[And any other options you want.] That'll define TEST, same as if
you'd put it in the preprocessor tab.

Nathan Mates
--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
AddThis Social Bookmark Button