Many people in C + + development have chosen vs as the development platform, but it is also possible to develop C + + with Eclipse. Here's how to use the CDT of Eclipse to build a standard C/D + + development environment.
1. Brief Introduction:
We know that the program consists of the source code to the last generation of the running program requires the following steps: Edit-and-compile connection. Eclipse is the editor, in order to be able to compile the C + + source code We also need a compiler, here we choose MinGW.
There is no introduction to eclipse, just a brief introduction to CDT and MinGW.
The CDT full-C + + development Toolkit is an open source project implemented entirely in Java. For us starters, it can be thought of as a plug-in used in eclipse, which can be used to develop C + + projects.
MinGW full name minimalist GNU on Windows, for us beginners only need to know that it is a compiler, you can compile C + + source code.
2. Download Eclipse
2.1 Search "Eclipse" keyword with Baidu
2.2 Open Website link
2.3 Find the download link for the version of Eclipse we need and click on the download page
2.4 Click to download
2.5 Unzip the downloaded file
3. Download MinGW
3.1 Search for "MinGW" keywords
3.2 Open Website link
3.3 Enter the official website, download the MinGW installer (please note here, we download only an installer, not the MinGW itself, the installer needs to be in a networked condition to automatically download the installation MinGW)
3.4 Open the download page, wait a moment, the download window will automatically pop up
3.5 Double click on the downloaded "mingw-get-setup.exe" file, the installer will pop up the main interface. Then select the file you want to download
3.6 You can complete the download and installation of MinGW as follows:
3.7 At this point we open the Installer directory (I am here: C:\MinGW\), you can see the various files of MinGW
4. Configuring the compiler MinGW environment variables
Just as the JDK installs the environment variables that need to be configured, when we finish installing MinGW, we also configure its environment variables. Here are the steps to configure environment variables under Win7:
4.1 Right-click on "Computer" and select "Properties" in the dialog box that pops up
4.2 Left-click Advanced System Settings
4.3 In the System Properties dialog box that pops up, left-click Environment variables
4.4 Under System variables (S), locate the PATH variable, click Select, and then tap Edit
4.5 Add the Bin directory of the MinGW to the variable value by moving the cursor to the end of the string in the variable value (V) edit box, and adding the following: C:\MinGW\bin ", note to use a semicolon"; " Separated
After you finish the above operation, click OK to close the dialog box. At this point, the setting of the environment variable is finished.
5 Installing the CDT plugin in eclipse
5.1 Open the Eclipse folder that you just unzipped and double-click Run "Eclipse.exe"
5.2 Open the Eclipse main screen and select "Help->eclipse Marketplace"
5.3 In the "Eclipse Marketplace" dialog box that pops up, find the "Find" edit box, enter the keyword "CDT", and then search, please keep your network unblocked, there is no network in the case can not be installed in this way plug-ins.
5.4 In the search results, we will find the "Eclipse CDT (c + + development tooling) 8.2.1 Kepler" plugin, click "Install", Eclipse will automatically complete the download installation plugin work
5.5 After installing the plug-in, restart Eclipse and find the button in the main interface that toggles the C + + and Java development environments as shown below.
5.6 Click to select C + + mode
5.7 Create a new C + + project
5.8 Compile, run. Note: Be sure not to forget to compile ("1" refers to the button), or you will see an error.
5.9 If it is not an accident, the result will be displayed at the bottom of the output box after successful operation
Write C + + program--CDT Environment building under eclipse