how to set MSBuild VC++ Directories

后端 未结 3 724
甜味超标
甜味超标 2021-01-11 13:45

I have a solution of mixed VB.NET and C++ projects. When using Visual Studio 2005 you can set the \"Tools->Option->Projects and Solutions->VC++ Directories\" to help the com

相关标签:
3条回答
  • 2021-01-11 14:20

    You can use /p[roperty]:useenv=true switch to forward environment variables in newer versions of MSBuild. See full article here http://blogs.msdn.com/b/vcblog/archive/2010/01/11/vcbuild-vs-c-msbuild-on-the-command-line.aspx

    0 讨论(0)
  • 2021-01-11 14:30

    To set the include directories, you can add them into your INCLUDE environment variable. You use the same format as in PATH env. variable - you separate paths with semicolons.

    To set the library directories - you can do it in similar way, by putting them into your LIB environment variable.

    To set environment variables, you simply right-click "My Computer", choose "Properties". Then you go to "Advanced" tab, and there's a button called "Environment Variables".

    Or, you can run MSBuild from a BATCH script, in which case, before calling MSBuild, you can set the INCLUDE and LIB variables, like so:

    set INCLUDE=C:\Libraries\LibA\Include
    set LIB=C:\Libraries\LibA\Lib\x86
    
    0 讨论(0)
  • 2021-01-11 14:30

    ...and also you may like to append %INCLUDE% and %LIB% to your variables to avoid overwriting of them

    set INCLUDE=C:\Libraries\LibA\Include;%INCLUDE%
    set LIB=C:\Libraries\LibA\Lib\x86;%LIB%
    
    0 讨论(0)
提交回复
热议问题