l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
January 6: Social gathering
Next Installfest:
TBD
Latest News:
Nov. 18: Club officer elections
Page last updated:
2006 Dec 16 08:17

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] [OT] Running/compiling win32 executables from cygwin
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



p@dirac.org wrote:
Is it possible to run win32 executables from a cygwin xterm?
I do it all the time.

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?
Batch files are normally "sourced" by cmd.exe, and given the name of the
batch file you are dealing with, it sounds like it is modifying
environment variables for the VC toolchain.

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.
Either translate vcvars32.bat to bash, or setup a .BAT file that
invokes both in sequence and then invoke that batch file from bash,
something like:

---vc---
#!/bin/sh
cmd /C MYVC.BAT $@
--------

---MYVC.BAT---
@ECHO OFF
VCVARS32
VC %1 %2 %3 %4 %5
--------------

It is possible to setup a "startup script" for a given instance
of CMD using a shortcut, which can then be placed in the program
files menu or on the taskbar.  Also, the System control has a
place to setup environment variables.

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

Thanks!
Peter
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


--
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!