Configuration method for C/C ++ development in Eclipse (Latest Version 20140721), eclipse20140721

Source: Internet
Author: User

Configuration method for C/C ++ development in Eclipse (Latest Version 20140721), eclipse20140721
Eclipse is an open-source and Java-based scalable development platform. In itself, it is only a framework and a set of services, used to build a development environment through plug-in components. -- It refers to Baidu encyclopedia.

Simply put, Eclipse is a free and open-source Java IDE, which is very useful. Especially after some extensible plug-ins are introduced, its functions can become very powerful.

But in fact, Eclipse can not only be used for Java programming, it supports a variety of languages, C, C ++, Ada, Python, PHP and so on. In Windows, many people are used to writing C and C ++ programs in Visual C ++ (or Visual Studio, this part of people will think that writing C and C ++ programs in Eclipse will always feel like they are either using chopsticks to eat western food or using knives and forks to eat Chinese food. Despite this, many people write C and C ++ programs in Eclipse. This article serves as a solution for those who love to try new things. Note: the installation and configuration in this article is applicable to Windows.


Although there have been many articles on the Internet that introduce C/C ++ development methods in Eclipse, they are all old, and software updates are always fast, the following describes the installation and configuration methods based on the current (July 21, 2014.


1. First, make sure that Java has been installed on your computer. If not, or you are not sure, please download and install it on the official website. The URL is as follows (I will not detail this step ):

Http://www.java.com/zh_CN/


2. Download and install Eclipse on the official website. The latest version is Eclipse Luna (4.4). The URL is as follows:

Http://www.eclipse.org/downloads/

Many versions are provided in the list, because they are used for C and C ++ programming, you need to select Eclipse IDE for C/C ++ Developers (and select 32-bit or 64-bit based on the system you are using), such as (note that the one in the red box is selected ), CDT has been integrated here.

The downloaded package is a compressed package, which can be decompressed directly without installation. Of course, the revolution is not yet successful, and comrades still have to work hard.


3. You need to download and install MinGW. MinGW, yesMinimalist GNU on Windows. It is a collection of Windows-specific header files that can be freely used and released, and imported using the GNU tool, allows you to generate local Windows programs on GNU/Linux and Windows platforms without the need for third-party C Runtime libraries. -- From Baidu encyclopedia. In short, this provides a lot of functions that you need to use when writing C code.


Official download site: http://www.mingw.org/, as shown in the red box, select the download Installer in the upper left corner and download it.



After the download is successful, get a mingw-get-setup.exe file, run and install it properly.

After successful installation, you will get an icon named MinGw Installer on the desktop. Because there are many MinGW content, you still need to select the desired part and install it online, double-click the MinGw Installer, as shown below:

Obviously, there are several packages that are required. First, Mark the packages you want to install (that is, the ones that are colored in) by right-clicking Mark for Installation in the menu, click Installation in the main menu bar, Select Apply Changes from the drop-down menu, and then install it (of course, you need to keep the network normal, because the installation program needs to be downloaded from the website in real time and then executed ).

4. Configure environment variables.

First, you need to change the name of mingw32-make.exe in C: \ MinGW \ binto make.exe (the premise is that you directly install MinGW in the C root directory), as shown in:


Next, configure the environment variables, right-click "my computer", select "properties", select the "advanced" tab in the pop-up dialog box, and click the "environment variables" button. As shown in the left figure.

Then, in the pop-up dialog box, edit the environment variables. The three variables are the three most important ones, that is, the three marked in red in the right figure. Note that you must edit the environment variables according to the installation path of your MinGW, for example, my MinGW is directly installed in the C root directory, so there are:

Include -- C: \ MinGW \ include

Lib -- C: \ MinGW \ lib

Path -- C: \ MinGW \ bin

Ps: if your computer is installed with other development tools, such as VC, it is best to put MinGW entries at the beginning.



Now, the basic installation and configuration steps have been completed. In principle, you can use Eclipse to program C and C ++. However, some people may encounter the following two errors when writing the actual program, mainly when executing the program, but cannot develop the program.

Launch failed. Bianry not found

A program file was not specified in the launch configuration

Many people ask online how to solve this problem, but there are basically no answers. (You can paste the preceding two error messages to the baidu search box ). I will introduce the countermeasures in the next article.



How to configure the C language development environment using Eclipse?

C ++ environment setup for beginners (Eclipse + CDT + MinGW)
Reference: blog.csdn.net/..7.aspx

I want to use eclipse to compile C language programs, but configuration and installation are complicated for me.

Dev-C ++
VisualC ++
VS2005
It is very convenient to debug C.
Eclipse is very slow. High requirements on machine configuration!
 

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.