Configure the CDT and MinGW Ultimate method under "Go" eclipse.

Source: Internet
Author: User

There are a lot of tutorials on how to configure CDT and MinGW in Eclipse, but most of them are early and some are not suitable for the current version. In order for those enthusiasts who love eclipse to plan to develop C + + on the Eclipse platform, instead of abandoning a colorful eclipse world because the first step has not been taken, I will introduce some methods for configuring CDT and MinGW under Eclipse.

There are many articles on the web that introduce eclipse configuration, but most steps are daunting. Here, the first part introduces the installation of Eclipse, the second part is the CDT+MINGW installation tutorial. The third part is the CDT+MINGW Orthodox installation. There is no essential difference between the two methods.
1. Install Eclipse and MinGW:
1.1 Installing Eclipse
To run eclipse, you first need to install the JDK, the recommended Oracle JDK SE (originally Java is Sun Company, and later by Oracle acquisition, so go to Oracle's website to download it.) ), the address is http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u1-download-513651.html, where you select the version that is appropriate for your operating system. When installed, the default installation path is C:\ProgamFile\Java. And when installing, be careful to add its path to the system environment variable so that you do not have to manually configure the environment variable.
Then, unzip the Eclipse tarball downloaded from http://www.eclipse.org/downloads/. If you are developing C or C + + only under Eclipse, download the eclipse IDE for C + + developers directly. Then jump directly to the MinGW installation of the section will be ready.

Culture in 1.1.1
It is recommended to use the English version directly, one is to exercise their own, the second is the computer, the English information is the most cutting-edge, the third is the interface in English, will appear to be very competent ...

If you must use the Chinese version, you can go to the URL: http://download.eclipse.org/technology/babel/babel_language_packs/R0.9.0/indigo/ Indigo.php Choose Chinese Simplified version, Babellanguagepack-eclipse-zh_3.7.0.v20110723043401.zip (87.19%), can be found, The translation progress of these language packs is mostly not 100%. Create a new language folder, unzip the selected language pack into it, and then import eclipse through the link method (see this article for the link method). Reboot after completion.

You can also download it online: Open Eclipse, then click Help->install New Software ... In the popup window, add the appropriate eclipse version of the Babel update address (Http://download.eclipse.org/technology/babel/update-site/R0.8.0/helios ), press ENTER. Eclipse will automatically look for various language packs on the server, which can take a few minutes. Online installation is very simple, select the appropriate language pack, click Next, then there will be a license agreement, click on the Accept, you can click Finish, so you can enter the installation phase. When the installation is complete, a reboot is required, and after the reboot it will be able to enter the eclipse interface in Chinese.
1.2 Installing MinGW

Go to the website http://sourceforge.net/projects/mingw/files/, directly click Downloads Download mingw-get-inst-xxxx.exe (not found?) Be patient, on the current page, I'm sure you can find it. This is an online installation package, where XXXX is the version number. Of course, offline packages can be found elsewhere, but security is not guaranteed. MinGW installation is not detailed, if you want to from the step, is double-click Open,

1. Next
2. Next
3. Select Use pre-packaged resossitory catalogues to install this version of 20101030. Select Download Lastest repository catalogues to install the current latest version. Choose whichever depends on you, usually with the first one can. Then next
4, agreement, select I Accept the agreement, continue next
5, the installation directory, the default is C:\MinGW, you can also change to another directory, continue next
6. Prompt to set the program name under the Program menu of the Start menu, default to MinGW. If you do not need to set up the Start menu directory, you can choose the "Create a Start" option folder.
7, prompt to select the installed components. In general, just choose c Compiler, C + + Compiler, MSYS Basic System is enough. Next
8, confirm the information. Tells you which components are installed and in which directory you chose to install. Click "Install"
9, the most important step, wait, do not do anything, will pop up a DOS window, began to download components.

After the download is complete, the MinGW should be installed in C:\MinGW (if you have not changed the installation path).

1.2.1 Configuring MINGW Environment variables

Right-click on the computer to open: "Computer--Properties-Advanced system settings-environment variables-System Variables" edit the following system variables: variable Path variable value added C:\MinGW\bin; (assuming your MinGW is installed in the C drive, and note that you should use the English semicolon to distinguish the variable values.) If XP, then "My Computer--Properties-advanced-environment variables-system variables." The other variables do not have to be in the pipeline, the network is the previous version of the MINGW environment variable configuration.

1.2.2 Remember to change the name of the C:\MinGW\bin Mingw32-make.exe to become Make.exe

2, the Fool type CDT installs

2.1 Installing the CDT online

Open Eclipse, then click Help->install New Software ... To add Http://download.eclipse.org/tools/cdt/releases/indigo to work in the popup window, press ENTER, and the following installation process is the same as installing the Chinese package above, I'm sure you can understand it easily. If your eclipse version is not 3.7, but another version, then please http://www.eclipse.org/cdt/downloads.php, query the corresponding CDT version, copy the corresponding P2 software Repository to work with window (what is work with?) Please look at the beginning of this paragraph. After the installation is complete reboot, do not need any action, you can compile C + + program, try it quickly. The testing process is in the appendix of this document.

2.2 But what do I want to do with offline installation?
It is not recommended to download the CDT Zip package to unzip the installation. There will be all sorts of mistakes. Of course, you still want to unzip the installation, see the third part of this article. Here, a simple and effective method is introduced. You can go to the next Eclipse IDE for C + + developers version and merge the plugins and features folders with the corresponding folders in eclipse that you are using. In this way, you can compile C + + by restarting Eclipse. Here you may want to ask some questions, don't worry. As I said earlier, if you are only using eclipse to develop C + +, install the corresponding version directly, then install MinGW. If the C/C + + version of Eclipse is not just being developed, it may not be possible to download the JDT, because this version does not have other tools such as the C + + version of Eclipse, and the other components need to be part of their own. In summary, it is easiest to replicate the plugins and features folders in the C/S version of Eclipse. Of course, this will also copy the Cvs/egit/mylyn/res components, but this is necessary for the development of the program, so I would like to. (according to the user's reply, here prompt, note the version of the corresponding, 3.6.0 eclipse, to use the 3.6.0 Eclipse for C plugins folder merge, otherwise it will be wrong.) And when merging, if there is a duplicate name, perform the replacement operation. )

There is also a reason that the occasional eclipse online installation will appear eclipse,cannot complete the install because of a conflicting dependency error. This error seems to be no solution at the moment. If this error occurs, you can install it offline (there may be other errors), or use the method above to make it simple and effective.

3, off-line conventional installation CDT.

Copy the features, plugins entire folder from the CDT compression package to the Eclipse installation file and restart Eclipse. There is no way to find GCC, g++ the solution is ... Forget it, it will toss you for a long time ... You can download an eclipse IDE for C/C + + developers version and use the plugins and features folders as the CDT installation package ...

4. CDT Version Description

A CDT corresponds to an Eclipse version, and the non-corresponding CDT may not be compatible with the Eclipse version. For example, 8.0.0 's CDT corresponds to the 3.7.0 eclipse,8.0.1 of the CDT corresponding to the 3.7.1 eclipse, the other same.

Appendix : Testing the configuration complete eclipse
Open Eclipse and click File--new--project--c/c++--c++ project--next--in the menu bar to enter the project name in project names-in the lower left part of the dialog box, project Type select Excutable, in which you select the Hello World C + + project--in the lower right section of Toolchains select MinGW gcc--finish.
A new code containing the Hello World program is created. Click on the menu bar a small hammer icon, is used to Build,build finished, click the menu bar Run button, that is, a green circle has a right triangle, this time in the Eclipse view of the console (console) appears!!! Hello World!!!。 At this point, you are done.

Description , the purpose of this article is to let everyone faster in the eclipse in the C + +, less detours, just began to write a few articles, errors inevitably, if there is no introduction clearly, please leave a message, I will be corrected. Reprint please out the source http://blog.csdn.net/sunny2038/article/details/6918602, but not mandatory requirements. Thank you.

Configure the CDT and MinGW Ultimate method under "Go" eclipse.

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.