VS2008 Command Prompt + Cygwin

前端 未结 3 812
一生所求
一生所求 2020-12-16 16:50

I use the VS2008 command prompt for builds, TFS access etc. and the cygwin prompt for grep, vi and unix-like tools. Is there any way I can \'import\' the vcvars32.bat functi

相关标签:
3条回答
  • 2020-12-16 17:09

    Here is my sample Cygwin.bat file that configures Visual studio and starts mintty

    @echo off
    @REM Select the latest VS Tools
    IF  EXIST %VS100COMNTOOLS% (
        CALL "%VS100COMNTOOLS%\vsvars32.bat"
        GOTO :start_term
    )
    
    IF  EXIST %VS90COMNTOOLS% (
        CALL "%VS90COMNTOOLS%\vsvars32.bat"
        GOTO :start_term
    )
    
    IF  EXIST %VS80COMNTOOLS% (
        CALL "%VS80COMNTOOLS%\vsvars32.bat"
        GOTO :start_term
    )
    
    :start_term
    
    C:
    chdir C:\cygwin\bin
    START mintty.exe -i /Cygwin-Terminal.ico -
    
    0 讨论(0)
  • 2020-12-16 17:22

    According to this page you need to:

    "Depending on your preference, you can either add the variables required for compilation direct to your environment, or use the vcvars32.bat script to set them for you. Note you have to compile from a cygwin bash shell, to use vcvars32, first run a DOS shell, then run vcvars32.bat, then run cygwin.bat from the directory where you installed cygwin. You can speed this up by adding the directory containgin vcvars32 (somewhere under \Microsoft Visual Studio\VC98\bin) and the directory containing cygwin.bat to your path."

    0 讨论(0)
  • 2020-12-16 17:33

    witkamp's answer works for vs2005 -- for vs2008, use

    CALL "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"

    0 讨论(0)
提交回复
热议问题