views:

822

answers:

3

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?

+9  A: 

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

Scott Hanselman
+4  A: 

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

@echo off

@REM Run vsvars.bat for visual studio support
CALL "C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"

C:
chdir C:\cygwin\bin


@REM bash --login -i
START rxvt -e bash --login -i
EXIT
witkamp
A: 

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

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

Nathan Monteleone