Configure eclipse to compile C/C ++ code

Source: Internet
Author: User

This article introduces two methods to compile C/C ++ using eclipse.Code

1. mingw + eclipse classic + CDT

(1) download and install mingw
Http://sourceforge.net/project/showfiles.php? Group_id = 2435
Install it in the first-level directory, such as D: \ mingw.
After installation, configure the environment variables as follows:
Mingw = D: \ mingw
Path = % mingw % \ bin; % PATH %
C_include_path = % mingw % \ include
Cplus_include_path = % mingw % \ Lib \ GCC \ mingw32 \ 4.6.2 \ include \ c ++; % c_include_path %
LIBRARY_PATH = % mingw % \ Lib

(2) install eclipse classic 4.2 and related plug-ins CDT

Http://www.eclipse.org/downloads/
Download eclipse classic 4.2
Go to the main interface, help-> install new softwares,
Under workwith, select Juno-

Http://download.eclipse.org/releases/juno,

You can install many plug-ins, such as programming extensions ages-> C/C ++ and CDT.

This method is recommended.

Ii. mingw + eclipse C/C ++ version
Eclipse for C/C ++ has a built-in CDT plug-in. You can directly download the eclipse for C/C ++ version.
Eclipse IDE for C/C ++ developers

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


Usage:
File, new, C ++ project, makefile project, right other toolchain select mingw GCC.

Compile:

Right-click the generated makefile, select make targets, build, and standalone add, and enter the target name, such as hello, in the pop-up window.

After successful addition, double-click the added target to compile.

See: http://wenku.baidu.com/view/701977bf1a37f111f1855b7e.html

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.