C Board  

Go Back   C Board > Community Boards > Tech Board

Reply
 
LinkBack Thread Tools Display Modes
Old 09-26-2006, 03:24 AM   #1
TmX
Registered User
 
Join Date: Sep 2006
Posts: 11
Cygwin & MinGW

I have Cygwin & MinGW installed on my laptop.
In the PATH variable , Cygwin has the higher priority.
But sometimes I want to invoke the MinGW GCC from the command line withoug CD-ing to it's installation directory

Any suggestion ?
TmX is offline   Reply With Quote
Old 09-26-2006, 05:01 AM   #2
erstwhile
 
Join Date: Jan 2002
Posts: 2,223
Change the path environment variable for that process i.e.,
Code:
set path=mingw_path;%path%
A batch/cmd(*.bat or *.cmd) file is useful in this regard as you can do other stuff, too, such as invoke make or other tools if you want.
__________________
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.
Ken Fitlike is offline   Reply With Quote
Old 09-26-2006, 07:08 AM   #3
Reverse Engineer
 
maxorator's Avatar
 
Join Date: Aug 2005
Location: Estonia
Posts: 2,258
I have my own "command" directory, where I put programs I want to run throguh command line. So there will be only my bat files and some console executables. You can make a bat file called "cyg.bat":
Code:
SET PATH=cygwin_path;%path%
and "mgw.bat":
Code:
SET PATH=mingw_path;%path%
So you can easily switch the path between Cygwin and MinGW by just "cyg" or "mgw".
__________________
The duck is irrelevant to my point.
maxorator is offline   Reply With Quote
Old 09-26-2006, 08:44 AM   #4
Registered User
 
Frobozz's Avatar
 
Join Date: Dec 2002
Posts: 546
Of course he could just have the batch file pass on the compiling as well:

Code:
SET OLDPATH=%path%
SET PATH=mingw_path;%path%
g++ %1 %2 %3 %4 %5 %6 %7 %8 %9
SET PATH=OLDPATH
Frobozz is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting SciTE to work with cygwin Witchfinder C Programming 1 02-21-2009 04:12 PM
from dev-c++ mingw to netbeans cygwin yahn C++ Programming 10 01-14-2009 08:18 AM
cygwin sshd weird behavior jEssYcAt Tech Board 6 05-19-2008 02:05 PM
Problems with compiling code in cygwin firyace C++ Programming 4 06-01-2007 08:16 AM
Cygwin Server osal Networking/Device Communication 0 03-07-2005 12:58 PM


All times are GMT -6. The time now is 04:55 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22