English 中文(简体)
Gvim, MinGW and Powershell making them work the CLI way
原标题:

Just shifted to windows7. Liking it :).
Is there a way to install MinGW in windows, such that, i can cd to my code directory (which is different from MinGW install directory) and compile my code there.
IF, no then what is the equivalent of $PATH (bourne shell) in windows, and how shall i set it. Can this trick (setting MinGW in default path of exe) work on windows7.

Any useful wiki s, blogs, forum would be very very helpful.

最佳回答

It s perfectly possible, first thing you have to do is download MinGW (see (1) below for some suggestions). Then install it using the installer if you have one or just decompress the files in a directory (i.e.: D:ToolsMinGW).

Now, set the PATH variable (Windows systems have it too) to point to the bin directory. To do so, go to Control PanelSystem and SecuritySystem and click in the Advanced system settings options in the left panel. There select Environmental Variables... and find it in the System variables list.

Note that in Windows the separator among the directories placed in the PATH variable is a ; instead of a :.

And you re all set, whatever is on a directory on the PATH should be accessible from the command line. Instead of using the system-wide PATH you may also create a PATH user variable, it s up to you.

To access an environmental variable from the command line you use %s (i.e.: echo %PATH%). Using the command set without parameters in a command line should display the current environment variables. You can use it to set the value of one too (i.e.: set LIBPATH=D:CodeLibraries).

(1). You may download it from several places: the original MinGW project (which has an installer too), TDM builds (also with an installer), MinGW-w64 (for 64-bit systems, but has toolchains targeting 32-bit too, also binaries for the 4.5 branch of GCC), ...

问题回答

暂无回答




相关问题
PCSC-Lite Codes on Windows

I ve successfully built a program that can read Mifare 1K Card using Qt on Linux. So now, I would like it to run on Windows. From what I ve gathered, there s no PCSC-Lite port on Windows and I need to ...

mingw + python eagerly translating path

I am using: Windows XP Python 2.6.2 (standard install from python.org) git version 1.6.5.1-preview20091022 (installed from http://code.google.com/p/msysgit/) I have an environment variable looking ...

Conversion specifier of long double in C

The long double data type can have these conversion specifiers in C: %Le,%LE,%Lf,%Lg,%LG (reference). I wrote a small program to test : #include <stdio.h> int main(void) { long double d = ...

Linux Development C/C++/bash/python on windows-7

Before resorting to stackoverflow, i have spend a lot of times looking for the solutions. I have been a linux-user/developer for few years, now shifting to windows-7. I am looking for seting-up a ...

Gvim, MinGW and Powershell making them work the CLI way

Just shifted to windows7. Liking it :). Is there a way to install MinGW in windows, such that, i can cd to my code directory (which is different from MinGW install directory) and compile my code there....

Which version of gcc to install with MinGW?

If compiling and linking with MinGW gcc v3 is painfully slow, and gcc v4 is not the default install option: What, for a beginner are the advantages/disadvantages of installing one version or another? ...

热门标签