Use Eclipse (V3.01) to build a CC ++ development environment under Windows under WINDW (V3.1.0)

xiaoxiao2021-03-06  42

Use Eclipse (V3.01) to build a C / C development environment under Windows under WINDW (V3.1.0)

1. Install MINGW

l From site http://mingw.sourceforge.net/ upload mingw-3.1.0-1.exe

l Install MINGW-3.1.0-1.exe, you can install it by default

l Configure the environment variable PATH, add "; c: / mingw / bin" (default installation path)

2. Install Eclipse and CDT plugin

l Upload the Eclipse version 3.0.1 from the site http://www.eclipse..org, then decompressed into C: / Eclipse (directory you will arrange it, as for the installation of JDK and configuration environment, here does not say, there are many online , Go to find it)

l Open Eclipse, select Menu HelpàSoftware Updatesnfind and INSTALL, pop up the "Feature Updates" dialog, select "Search for new feature to install", go to the Update Sites To Visit dialog, select the right button "New Remote Site", " Name "column, just fill a name, such as" CDT "; fill in" http://update.eclipse.org/tools/cdt/releases/new., then Next, choose the latest version "Eclipse C / C Development Tooling SDK "Installing" Eclipse C / C Development Tools "

3. Configure the development environment

l Open Windows àpreferences, select C / C ànew make projects, in the Make Builder column, modify build commond for mingw32-make

l Modify the Binary Parser column, select Pe Windows Paser, put it in the forefront

4. Example

l Managed Make C Project

1) Fileànewà Projectàcà Managed Make C Project, enter Project Name, such as "TestManageDC", the rest of the selection default, establish a new project

2) Fileànew àfile, build a main.c file, enter the code:

#include

Int main () {

Printf ("Hello, World");

Return 0;

}

3) Projectàproperties, in the C / C Build one, select the Manage button behind the Configuration to modify the Make Commond column, replace "make -k" to MingW32-make.

4) Projectàbuild Project

5) Runàrun ..., select C / C Local, select the next New button to create a new Configuration, Name, in the main bar, Project A Browse button, select the current project; C / C Application With Search / Browse, select the currently available execution file name (must be generated, true BT), so you can pass Run and Debug function.

l Standard Make C Project

1) FileàNewà ProjectàCà Standard Make C project, enter the project name, for example "teststandardc", next, modified Build commond as mingw32-make -f makefile, the rest select the default Make Builder in C / C make project setting, create a new Project .2) Fileànew àfile, build a main.c file, enter the code:

#include

Int main () {

Printf ("Hello, World");

Return 0;

}

3) Fileànew àfile, build a Makefile file, enter the code:

Main: main.o

G -o main main.o -l c: /mingw/lib/gcc-lib/mingw32/3.2.3/ -LSTDC

Main.o: main.c

G -ggdb -c main.c

All:

$ {Make} main

Clean:

-ndel main.o

4) Projectàbuild Project

5) Runàrun ..., select C / C Local, select the next New button to create a new Configuration, Name, in the main bar, Project A Browse button, select the current project; C / C Application With Search / Browse, select the currently available execution file name (must be generated, true BT), so you can pass Run and Debug function.

转载请注明原文地址:https://www.9cbs.com/read-86819.html

New Post(0)