built-in variables for VC?

Hello everyone,


I always notice that some guys are using some VC built-in variables to specify some properties, like OutDir, ProjectName, SolutionName, etc. Then we can use the built-in variables to specify, for example, the generated library name, like $(OutDir)/$(ProjectName).lib.

I think this way is very convenient compared with hardcoded names. I am wondering where can I find a list of all such built-in variable names and meanings


thanks in advance,
George


Answer this question

built-in variables for VC?

  • keith_co

    AaronGo wrote:
    Is it possible to change/override those variables
    The value of some variables like $ (OutDir)can be user-defined via the Project's Settings. But, this does not stand true for all variables. For instance, being able to override $(ProjectName) would defeat it's purpose.

    I hope this answers your question...


  • Bridgeway

     AaronGo wrote:
    I have Visual Studio 2003 and 2005 installed on this computer, but I would like to be able to build my projects created in 2003 on a computer that has only 2005 installed.  I can't seem to buy another copy of 2003 as it is no longer sold
    While someone from Microsoft may be better at reacting to this statement, I really don't think Visual Studio 2003 has been pulled out of the shelves.

    For one, it is certainly still supported and is available for download via a MSDN subscription.

     AaronGo wrote:
    How does one build 7.x solutions via the command line Is there an easy way to build the whole solution   This would be a step in the right direction, but would defeat the purpose of using an IDE at all.
    Bulding via commandline parameters wouldn't defeat the purpose of an IDE when used in the right context. (IDEs are used also for writing code, and debugging apart from just building).

    So, the command line parameter for building a solution using Visual Studio 2003 would be:

    • <Visual Studio 2003 Path>\Common7\IDE\devenv.com SolutionName.sln /Build BuildConfigName

    So, for instance, I would build a solution called TestSolution.sln in Debug configuration using VS 2003 by the command line parameter:

    • "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.com" TestSolution.sln /Build Debug

    In general, to know the command-line parameter support of Visual Studio, you can simply enter the following text in your "Run" window -

    • devenv /

    This would give you the command line arguments for VS 2005. While the majority of them are common to VS 2003 too, you can get VS 2003 specific command line arguments (the majority are common to VS 2005) via using the application specific path -

    • <Visual Studio 2003 Path>\Common7\IDE\devenv.com  /

    HTH...



  • eric shih

    So I need to find a way to get visual studio 2003 for my other computers Without an MSDN subscritpion, buying two visual studio licenses for every installation point could get pretty expensive. But even buying 2003 from a reseller is very difficult. I checked through the reseller list, and http://www.cdw.com/shop/products/default.aspx EDC=485698 is the closest I could find. But I presume that the VS2005 liscence wouldn't apply to 2003 Correct me if I'm wrong.

  • JacksonJones

    You can find the meaning of many of the macros by clicking on the [ ... ] button when you're editing eg. the generated library name. Once there, you will see a dialog box similar to http://www-sldnt.slac.stanford.edu/nld/new/Docs/GettingStarted/MSVC++/images/Fig8.gif. Clicking on the Macros>> button will list most of the macros. The rest, you can get from http://msdn2.microsoft.com/en-us/library/c02as0cs.aspx.

    PS. those macros are only available to Visual Studio and custom VC Wizards. They're not available programmatically (unless your program happens to be a Visual studio extension/appwizard).



  • Wojtek

    Because I would like to try to be able to make it use the Visual Studio 2003 build tools so that I can build a managed C++ project in .net 1.1. It's possible to change the references to use the 1.1 libraries, but Visual Studio still insists on using the 2.0 framework build tools. If I can make it look for the 1.1 build tools rather than the 2.0 build tools I would have a (somewhat hackish) way to build 1.1 projects from VS 2005.

  • Amde

    I was wondering specifically about $(InstallDir)

  • su45937

     AaronGo wrote:
    Because I would like to try to be able to make it use the Visual Studio 2003 build tools so that I can build a managed C++ project in .net 1.1. It's possible to change the references to use the 1.1 libraries, but Visual Studio still insists on using the 2.0 framework build tools. If I can make it look for the 1.1 build tools rather than the 2.0 build tools I would have a (somewhat hackish) way to build 1.1 projects from VS 2005.
    So long as you have Visual Studio 2005 with Framework 2.0, what makes you want to
    build some applications using Framework Version 1.1, and others using 2.0

    Wouldn't it be simple if all were built and shipped using Fx 2.0, or conversely - if all were built and shipped using VS 2003 and .NET Fx 1.1

    Additionally, as you seem to have VS 2003 installed - why tortue VS 2005 into using VS 2003's libraries and frameworks

    (BTW, one can also build 7.x solutions made using VS 2003 via the command line...)

    Also, why use VS 2005 if VS 2003 and it's frameworks are so important

    Something is amiss... Perhaps, you need to furnish more information.



  • bomberchia

    I have Visual Studio 2003 and 2005 installed on this computer, but I would like to be able to build my projects created in 2003 on a computer that has only 2005 installed. I can't seem to buy another copy of 2003 as it is no longer sold, and installing my current copy onto another computer would be piracy.

    Certainly I would like to upgrade to Fx 2.0, however not all my users have 2.0 installed, while it seems that everyone with XP has 1.1 installed. Asking my users to download the relatively large 2.0 framework is unacceptable.

    Thus, I was hoping to use the 2005 IDE to build applications using the old framework.

    How does one build 7.x solutions via the command line Is there an easy way to build the whole solution This would be a step in the right direction, but would defeat the purpose of using an IDE at all.

  • peterjp

    George2 wrote:
    I am wondering where can I find a list of all such built-in variable names and meanings
    You will find these documented in here.


  • Boise83716

     AaronGo wrote:
    I was wondering specifically about $(InstallDir)
    This indicates the directory into which VS.NET was installed. Why would you want to override it (post-installation)


  • nglow

    Is it possible to change/override those variables

  • built-in variables for VC?