From http://download.csdn.net/detail/aft_momo/4045979
Download mingw, which is officially recommended for online installation, but can also be installed offline (more complex)
Download the mingw minimum requirement package (including the C compiler ). The list is as follows:
(1) binutils
(2) mingw-runtime-dev mingw-runtime-DLL
(3) w32api
(4) required runtime libraries for GCC:
A) MPC-dev MCM-DLL
B) mpfr-dev mpfr-DLL
C) GMP-dev GMP-DLL
D) pthreads-dev pthreads-DLL
E) gomp
F) SSP
G) Intl
H) iconv-dev iconv-DLL
(5) GCC-core-bin gcc-core-DLL
3. Copy all downloaded packages to files in the Same Name (such as tar.lzmaand tar.gz), copy them to F: \ mingw, and add the environment variable mingw_home = F: \ mingw.
4. optional installation of C ++ compiler, Ada compiler, Fortran compiler, and objectc Compiler
C ++ compiler needs to be downloaded
Gcc-C ++
Libstdc ++
Download the ADA Compiler
Gcc-ADA
Libgnat
Download the Fortran Compiler
Gcc-Fortran
Libgfortran
The objectc compiler must be downloaded.
Gcc-objc
Libobjc
Note: These compiler packages must be of the same version as the GCC-core package.
Optional installation
Make build tool
Make
GDB debugging tool
GDB
Libexpat
Note: After the make tool is installed, copy mingw32-make.exeand change it to make.exe for eclipse. Install all packages in the same way. Unzip the package twice using 7-zip and copy it to the mingw directory.
5. Set system environment variables.
Path
Append % mingw_home % \ bin; % mingw_home % \ libexec \ GCC \ mingw32 \ 4.5.2
Note: For Versions later than 3.2, do not set the following environment variables if they are only used by ECLIPSE (without using command lines); otherwise, the duplicate include path entry warning will appear in eclipse.
LIBRARY_PATH =
% Mingw_home % \ Lib; % mingw_home % \ Lib \ GCC \ mingw32 \ 4.5.2
C_include_path =
% Mingw_home % \ include;
% Mingw_home % \ Lib \ GCC \ mingw32 \ 4.5.2 \ include
Cplus_include_path =
% Mingw_home % \ Lib \ GCC \ mingw32 \ 4.5.2 \ include \ c ++;
% Mingw_homw % \ Lib \ GCC \ mingw32 \ 4.5.2 \ include \ c ++ \ backward;
% Mingw_home % \ Lib \ GCC \ mingw32 \ 4.5.2 \ include \ c ++ \ mingw32;
% Mingw_home % \ include