Question

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 functionality into the cygwin environment so I can call "tfs checkout" from cygwin itself?

Was it helpful?

Solution

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."

OTHER TIPS

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 -

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top