Simple version:
1. Download mingw:http://www.mingw.org/
2. Installing MinGW
3. Add the path value in the environment variable equal to MinGW's installation path C:\MinGW\bin (MinGW's installation directory \ Bin path)
4. Press win + R, enter "cmd" and run cmd;
5. Switch to the source file path and enter g++ Hello_world.cpp-o Hello_world
6. Input: Hello_world
Verbose version:
Under Windows, I used the MinGW.
1. Download MinGw
Official website address: http://www.mingw.org/, click "Downloads" in the left menu, will be directed to http://sourceforge.net/projects/mingw/files/website.
2. After the download, it is installed, double-click "Mingw-get-setup.exe" file, in the pop-up form, select "Install" for installation, we entered the
, we click "Continue" to continue installing MinGW.
2nd step: Download and configure the MinGW Setup Manager
Will download some files, we wait a moment, and then
, entered the
I have chosen the right. Next, we choose "Installation" in the menu, select "Apply changes", will go to install our choice of package,
After the installation is complete.
, after clicking "Close", we installed the MinGW.
3. Configure the MinGW to path
Go to the Windows 7 desktop, select the "Computer" icon, right click on the pop-up menu, select "Properties", we select the left
, in the lower right corner we can see this button, select it,
Here we add the installed directory of the MinGW installation,
, click the "OK" button, then click the "OK" button again.
We are opening cmd (click the Win button on the keyboard +r key, go to the "Run" dialog box, we enter "cmd" in the "Open" field, click the Enter key); we enter: Gcc-v
A similar result shows that our MINGW environment has been successfully configured.
I know the compile command is:
GCC source file-o destination file
such as: GCC helloworld.cpp-o HelloWorld
After compiling, we enter: HelloWorld, you can get the results of the program.
This is my own editor of a C + + program, the program source code from the "C + + Primer Plus 6th edition Chinese Version" of the case of Chapter 2.5.
In fact, I have used the Code::Blocks IDE, in the inside, I bulid a project, then run, you can see the results of the run. But as a novice, I think still want to understand the basic operation, such as compile, run the command, so at the end of the article, remember I just learned the compilation command, hey.
C + + Getting Started configuring C + + development environment