Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2008 Command Prompt + Cygwin

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?

like image 371
Agnel Kurian Avatar asked Sep 15 '08 09:09

Agnel Kurian


3 Answers

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

like image 60
Scott Hanselman Avatar answered Oct 17 '22 23:10

Scott Hanselman


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 -
like image 39
Ted Avatar answered Oct 18 '22 00:10

Ted


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

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

like image 1
Nathan Monteleone Avatar answered Oct 18 '22 00:10

Nathan Monteleone