Use eclipse for C/C ++ Development

Source: Internet
Author: User

1. software to be installed

(1) Dev-C ++.

: Http://www.bloodshed.net/devcpp.html

Note: compile C/C ++CodeCompiler

(2) JDK.

: Http://java.sun.com/javase/downloads/index.jsp

Note: If you are not engaged in professional Java Development, select Java SE runtime environment, because we only need it to provide the eclipse runtime environment.

(3) eclipse.

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

Select Eclipse IDE for C/C ++ developer windows

 

2. Start eclipse and configure it as follows:

Note: This project is added to the dev-C ++ compiler in eclipse, that is, some paths are provided so that eclipse can find them to compile the code.

Assume that Dev is installed in the D:/Program Files directory. The specific operations are as follows:

Eclipse menu bar-window-preferences-in the pop-up preferences window, expand the C/C ++ item on the left-environment-in the single-host C/C ++ item-

Click Add... on the right of the preferences window... button-enter path in the name input box of the new varilable window popped up-enter D:/program files/DEV-CPP/bin in the value input box-click OK button below-

Click Add... on the right of the preferences window... button-in the name input box of the new varilable window that appears, enter LIBRARY_PATH-in the value input box, enter D:/program files/DEV-CPP/lib-click the OK button below-

Click Add... on the right of the preferences window... button-in the name input box of the new varilable window popped up, enter c_include_path-in the value input box, enter D:/program files/DEV-CPP/include-click the OK button below-

Click Add... on the right of the preferences window... button-in the name input box of the new varilable window that appears, enter cplus_include_path-in the value input box, enter D:/program files/DEV-CPP/include; D: /program files/DEV-CPP/include/C ++/3.4.2; D:/program files/DEV-CPP/include/C ++/3.4.2/mingw32; D: /program files/DEV-CPP/include/C ++/3.4.2/backward; D:/program files/DEV-CPP/lib/GCC/mingw32/3.4.2/include-click the OK button below-

Click the Apply button at the bottom right of the preferences window-click OK (if you do not want to perform other settings, click OK only)

By now, eclipse has been able to start and find the C/C ++ code compiler in the path we set.

3. Restart eclipse

eclipse menu bar-file-New-C ++ project (or C Project)-enter a custom project name (such as test) in the project name input box) -Cancel the default selection of "show project types and toolchains only if they are supported on the platform" under the window-executable under project type on the left in the C ++ project window select Hello World C ++ project (or Hello World ansi c Project) -In the toolchains window, select mingw gcc-click the finish button-expand the new project (such as test) that appears in the project Explorer window-(if the project does not have binaries and the problem below the eclipse window) S: The path cannot be found. Restart eclipse.)-double-click * under SRC *. CPP (such as test. CPP) file-you can see that the system has automatically generated some code-Ctrl + B to compile this project-run.

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.