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 ?
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 ?
Change the path environment variable for that process i.e.,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.Code:set path=mingw_path;%path%
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.
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":
and "mgw.bat":Code:SET PATH=cygwin_path;%path%
So you can easily switch the path between Cygwin and MinGW by just "cyg" or "mgw".Code:SET PATH=mingw_path;%path%
"The Internet treats censorship as damage and routes around it." - John Gilmore
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