Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: Andrew Schulman <andrex AT alumni DOT utexas DOT net>
Subject:  Re: setting Win32 environment variables in Cygwin
Date:  Thu, 21 Jul 2005 05:28:43 -0400
Lines: 32
Message-ID:  <dbnpsc$mrg$1@sea.gmane.org>
References:  <9bbd2794050720120434ea1470 AT mail DOT gmail DOT com>
Mime-Version:  1.0
Content-Type:  text/plain; charset=us-ascii
Content-Transfer-Encoding:  7Bit
User-Agent: KNode/0.9.1
X-Archive: encrypt
X-IsSubscribed: yes

> Specifically, I need to do
> 
> Set PATH=C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin;%PATH%
> Set INCLUDE=C:\Program Files\Microsoft Visual C++ Toolkit
> 2003\include;%INCLUDE% Set LIB=C:\Program Files\Microsoft Visual Studio
> .NET 2003\Vc7\lib;C:\Program Files\Microsoft Visual C++ Toolkit
> 2003\lib;%LIB%
> 
> So that VC++ will run properly from the command line. Any suggestions?

Since these variables are to be used by a Windows app, it would make most
sense to set them in Windows.  Then they'll be available to all Windows
apps (including others that might start VC++), and also in Cygwin.  In XP,
you can use the so-well-hidden-it's-almost-gone environment variables pane: 
right click on my computer, Properties, Advanced, Environment Variables. 
You may find it easier just to enter them directly into the registry: 
HKCU\Environment for user-specific variables, or
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment for
system-wide variables.

For path variables that you want to use in both Windows and Cygwin, there is
a path conversion problem, as Igor says.  If you're using VC++ and not gcc,
then you can just leave INCLUDE et al. as Windows-format paths.  But if you
want to launch both from Cygwin, then you have a problem, because either
path format (Windows or Cygwin) will be wrong for one of them.  I guess
what's needed is to put the paths into Cygwin format, and write a wrapper
script for VC++, that converts them back to Windows format first. 
Fortunately cygpath(1) can make these conversions for you.

Good luck,
Andrew.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/