[vox-tech] [OT] Running/compiling win32 executables from cygwin

p at dirac.org p at dirac.org
Fri Dec 15 12:18:09 PST 2006


Is it possible to run win32 executables from a cygwin xterm?

I'm trying to figure out how to compile stuff using VC++ from the command
line at work.  When using the "command prompt", I need to run a batch file
to set up the environment:

   $ c:\Program Files\Microsoft ... 2003\Common7\Tools\vsvars32.bat

   cl /EHsc foo.cpp
   Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
   Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

   foo.cpp
   Microsoft (R) Incremental Linker Version 7.10.3077
   Copyright (C) Microsoft Corporation.  All rights reserved.

   /out:foo.exe
   foo.obj


However, from cygwin, it appears to fail silently:

   $ vcvars32.bat

   c:\Documents and Settings\psalzman\home\programming\cmdline>"c:\Program
   Files\Microsoft Visual Studio .NET 2003\Common7\
   Tools\vsvars32.bat"
   Setting environment for using Microsoft Visual Studio .NET 2003 tools.
   (If you have another version of Visual Studio or Visual C++ installed and
   wish to use its tools from the command line, run vcvars32.bat for that
   version.)

   $ cl foo.cpp
   $ ls
   Makefile*  foo.cpp

I'd rather work in cygwin since I'm more comfortable and familiar with that
environment.  Is it possible to use cl.exe from cygwin?  Maybe it's a matter
of environment variables?

Also, does the "command prompt" have an equivalent to a .bashrc?  If I
*have* to use it to do command line compiling, I'd rather change my prompt
to "$ " and run vsvars32.bat automatically since the only time I'll be using
the "command prompt" is when I'm compiling my programs.

They gave us WinXP at work, if the OS makes a difference.

Thanks!
Peter


More information about the vox-tech mailing list