Install and configure mingw in Windows XP

Source: Internet
Author: User

Install and configure mingw in Windows XP

To the http://sourceforge.net/projects/mingw/ manually download the latest mingw, or use mingw-5.1.4.exe, automatic download. However, the latter often cannot download the latest stable package.

1. Manual download instructions, see http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite
You can download from: http://sourceforge.net/projects/mingw/ selection package.

2, run the MinGW-5.1.4.exe, select candidate, generally will download the latest package, select the following items:
Mingw base tools
G ++ Compiler
Minggw make

Default path: C:/mingw, which is installed in D:/cplusplus/mingw.

By: http://wiki.codeblocks.org/index.php? Title = mingw_installation. You need to download the following necessary packages:
* Http://prdownloads.sf.net/mingw/gcc-core-3.4.5-20060117-1.tar.gz
* Http://prdownloads.sf.net/mingw/gcc-g++-3.4.5-20060117-1.tar.gz
* Http://prdownloads.sf.net/mingw/mingw-runtime-3.9.tar.gz
* Http://prdownloads.sf.net/mingw/mingw-utils-0.3.tar.gz
* Http://prdownloads.sf.net/mingw/w32api-3.6.tar.gz
* Http://prdownloads.sf.net/mingw/binutils-2.17.50-20060824-1.tar.gz
* Http://prdownloads.sf.net/mingw/mingw32-make-3.81-1.tar.gz
The other is the debugger:
* Http://prdownloads.sf.net/mingw/gdb-6.3-2.exe

After installation, configure the environment variables.

Control Panel --> System --> detailed system settings --> Environment Variables
Mingw_path = D:/cplusplus/mingw
C_include_path = % mingw_path %/include; % mingw_path %/lib/GCC/mingw32/3.4.5/include
Cplus_include_path = % mingw_path %/include/C ++/3.4.5; % mingw_path %/include/C ++/3.4.5/mingw32; % mingw_path %/include/C ++/3.4.5/backward; % c_include_path %
LIBRARY_PATH = % mingw_path %/LIB; % mingw_path %/lib/GCC/mingw32/3.4.5

Path = % mingw_path %/bin; % mingw_path %/libexec/GCC/mingw32/3.4.5

Note: many of the above versions 3.4.5 are GCC version numbers. The actual folder should prevail.

Open a cmd now.
Input g ++ -- version
If you see the following information, it will be half done.
Reading specs from D:/cplusplus/mingw/bin/../lib/GCC/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5-20060117-3/configure -- With-GCC -- With-GNU-LD -- wi
Th-GNU-as -- Host = mingw32 -- target = mingw32 -- prefix =/mingw -- enable-threads -- dis
Able-NLS -- enable-languages ages = C, C ++, f77, Ada, objc, Java -- disable-win32-registry -- d
Isable-shared -- enable-sjlj-exceptions -- enable-libgcj -- disable-Java-AWT --
Out-X -- enable-Java-GC = Boehm -- disable-libgcj-Debug -- enable-interpreter -- enabl
E-hash-synchronization -- enable-libstdcxx-Debug
Thread model: Win32
GCC version 3.4.5 (mingw-Vista special R3)

Create a new test. cpp File
The content is as follows:
# Include <iostream>
Using namespace STD;
Int main (INT argc, char ** argv)
{
Cout <"yeah, mingw! "<Endl;
Return 0;
}
Enter the compilation command under cmd.
G ++-O test. cpp
This time it was successful if nothing was seen.

Access test.exe
Have you seen the following information?
Yeah, mingw!

Now, you can write your C or C ++ program under XP.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.