Poechant quick installation and configuration Tutorial: Windows + ecplise CDT + mingw Development Environment

Source: Internet
Author: User

Operating System: Windows

1. Download eclipse CDT and mingw

(1) download Eclipse:

Http://www.eclipse.org/downloads/download.php? File =/technology/EPP/downloads/release/indigo/R/eclipse-cpp-indigo-incubation-win32.zip & url = http://mirrors.ustc.edu.cn/eclipse/technology/epp/downloads/release/indigo/R/eclipse-cpp-indigo-incubation-win32.zip&mirror_id=1093

(2) download mingw:

Http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/mingw-get-inst-20110530/mingw-get-inst-20110530.exe/download

2. Configure mingw

(1) double-click the downloaded mingw file to install mingw;

(2) Set environment variables:

Create mingw = c: \ Programs \ mingw

Create LIBRARY_PATH = % mingw % \ Lib

Add after path; % mingw % \ bin

(3) change the make name

Change \ bin \ mingw32-make.exe under the mingw installation directory to \ bin \ make.exe ".

(4) Check whether mingw is configured successfully

Windows key + R-> enter "cmd" (go to the console)-> enter "GCC"-> display "GCC: no input files" indicates that the GCC configuration in mingw is successful.

Windows key + R-> enter "cmd" (go to the console)-> enter "G ++"-> display "GCC: no input files "indicates that G ++ in mingw is successfully configured.

Windows key + R-> enter "cmd" (go to the console)-> enter "make"-> display "Make: *** no targets specified and no makefile found. stop. the make configuration in mingw is successful.

3. Configure eclipse CDT

(1) decompress eclipse cdt, and then double-click eclipse.exe ".

(2) configure the workspace of eclipse CDT.

(3) set the default tool chain to mingw:

Windows-> preferences-> C/C ++-> New CDT Project Wizard-> select mingw in the right toolchains-> click the long button "make toolchain (s) preferred ".

(4) set binary parse

Windows-> preferences-> C/C ++-> New CDT Project Wizard-> makefile project-> select PE windows parsers in binary parse.

4. Create the simplest C ++ project instance

(1) c ++ Project

File-> New-> C ++ project-> enter the project name.

(2) source file

Right-click "hello"-> New-> source file in project explorer and enter the file name.

#include <iostream>using namespace std;int main(void){    cout << "hello world!" << endl;    return 0;}

(3) makefile

Right-click "hello"-> New-> file name in project explorer and enter "makefile ".

all:g++ hello.cpp -o hello

5. Compile the C ++ project instance

(1) window-> show view-> make target-> right-click "make target" on the right and choose "hello"-> New-> Target name = compile-> remove "Same as the target name ". ", set make target to "all ".

(2) double-click compile in "hello" on the right.

6. Run the C ++ project instance

Run-> RUN configurations-> C/C ++ application-> hello.exe-> common-> select debug and run-> apply-> 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.