2013年4月10日 星期三

[eclipse][c][cpp] Eclipse C&Cpp Development

[eclipse][c][cpp] Eclipse C&Cpp Development

1.Download and Decompress Eclipse IDE for C/C++ Developers
2.Download and Install MinGW
  • Directory : C:\MinGW
  • Environment Variable [PATH] : PATH=C:\MinGW\bin
  • Renaming C:\MinGW\bin\mingw32-make.exe to C:\MinGW\bin\make.exe

3.Installing Eclipse Plugin : C/C++ Development tool CDT
  • Go to Help ‣ Install New Software
  • Add CDT to Available Software Sites
  • Select the main CDT Plugin for installation : CDT Main Features

4.Click File ‣ New ‣ Project
5.Select C Project
../../../_images/e-wiz-new-prj-sel-c.png
6.Name the project as Hello World
7.Select project type as Hello World ANSI C Project
8.Select Tool-chain as MinGW GCC
Select an empty Hello world ANSI C Project
9.Click Next button
10.Input your details
Input your details
11.Click Next button
12.Select Advanced settings
Go to Advanced Settings
13.Select Current bulder as Gnu Make Builder
Select GNU Make builder in advanced settings of Eclipse
14.Click OK button
15.Click Finish button
16.If you get a message to switch perspective, Click Yes 
Accept the request to change the perspective.
This happens if the previous perspective was not C/C++ perspective.
This is how the Project Explorer view would look like.
A sample view of the Project Explorer of Eclipse
1.The name of the project HelloWorld
2.Eclipse would list executables and libraries of the project here.
3.Eclipse would list include directories and header files here.
4.Eclipse generated folder. The name is derived from the build configuration.
5.Eclipse generated Makefiles
6.The actual source file.
To build the project, do either of:
  • Press Ctrl + B
  • Click Project ‣ Build All
  • Press the Build Button


Ref :
http://eclipsebook.in/advanced-eclipse/extending-eclipse/installing-cdt/
http://eclipsebook.in/c-cpp-development/building-code/build-eclipse-managed/

沒有留言:

張貼留言