Using ECLIPSE+MINGW to build a C/D + + development environment

Source: Internet
Author: User

  A friend asked me to help run a C program and I am now mainly in Java, the computer also has no C language compilation and development environment, in the study of Java during this period, exposed to eclipse this powerful IDE, used to. In order to debug a program, to install a vs think it is not worth it, but also curious whether eclipse can be built through the plug-c + + development environment??? By looking at the blog post on the Internet, it is true that a lot of people have realized, but I follow their methods to build, midway through a lot of problems, through their own groping, and eventually successfully build success. Each person's situation is different, in order to give everyone a reference choice, so write down this blog:

Premise: Your download of Eclipse is not eclipse for C + +;

Objective: To enable your eclipse to develop Java and develop A/C + +;

1. Need software:

    • jdk1.7 (go to the official website)
    • Eclipse (I'm using the version of Luna)
    • Eclipse/C + + developmer Tools SDK Plugin
    • MinGW (the latest version is good)

2. Build steps:

Installation of JDK and Eclipse and configuration of environment variables are not discussed here. On the premise of mounting the JDK and eclipse:

  • Install the CDT plugin: open eclipse->help->install New software ..., click Add in the Open window, pop up the dialog (Add Repository), enter the CDT in the Name box The Location box enters Http://download.eclipse.org/tools/cdt/releases/galileo enter to confirm. After that, the plug-in is automatically installed and ready for installation.
  • Install MinGW: download URL: http://www.mingw.org/download.shtml; Open the page and click Download Mingw-get-setup.exe (86.5 kB), download and install it. Note that the installation path must not contain spaces, this path is the last loaded MinGW path, my installation path is D:\MinGW; under the bin file, there is a mingw-get.exe; open, just select Install Mingw32-base, MINGW32-GCC , mingw32-gcc-g++, Mingw32-make These can be, a single check right mark for installation, all marked well click on the upper right corner of the installation select Apply Changes. will automatically download the installation, install it can find a mingw32-make.exe under the Bin folder to rename it to Make.exe. Then add the MinGW below the bin to the system variable path, and if the path variable is not empty, first enter a semicolon at the end and then glue the bin path below MinGW to the back (as my path is D:\MinGW\bin).   Once installed, you can enter GCC-V in the console to verify that the MinGW is installed. The prompt is successful.
  • set Eclipse: in order for the CDT to be able to use MinGW to compile the C + + program, we need to make the following settings in eclipse: window->preferences->c/c++->new CDT Project Wizard->makefile Project find Binary Parser cancel Elf Parser re-election PE Windows Parser so the development environment is set up.

3, Problems and solutions:

    • When creating a C + + project Toolchains There is no MinGW GCC, even the left project type even executable is not only makefile project, please try the following show project Types and Toolchains only if they is supported on the platform before the default checkmark is removed.
    • Create a good project inside to write a C program, you will find unresolved inclusion: <stdio.h> and other hints, that is, the function library is not introduced. Select Window->preferences->c/c++->environment First, click on the right of Add,name:c_path (the value of Name can be arbitrarily taken); Value:d:\mingw\include (i.e. MinGW below the include file path), confirm; then select Project->properties->c/c++ General->path and Symbols select GNU C on the right and click Add ... In the pop-up dialog, click Variables ... You can select the name value that we have named in the previous step and add it.

Test a C program:

1 #include <stdio.h>2 #include <stdlib.h>3 4 int main (void) {5     puts ("!!! Hello,world!!! " ); 6     return exit_success;7}  

Press Ctrl+b to compile and right-select Run as to perform the following results:

Finally, I hope that these can really help everyone in the eclipse to build a C + + development environment to play a certain helping!!!

Using ECLIPSE+MINGW to build a C/D + + development environment

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.