DOC PREVIEW
Saddleback CS 1B - Eclipse Tutorial

This preview shows page 1-2-3-4 out of 11 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Eclipse Tutorial What is Eclipse Integrated Development Environment IDE A Universal Platform for Development Tools Open extensible architecture based on plug ins Open source see the Eclipse Project at Eclipse org Multi platform multi language multi vendor Endorsed by major tool vendors Reduced Complexity through customizable perspectives and views Support for popular features through open standards Plug in development environment PDE C development tools CDT Eclipse Platform Platform Standard Java2 Virtual Machine Java VM 2 1 Tutorial How to get started See the tutorial at http cs saddlback edu Eclipse Resources Creating a C Project Close the Welcome to get to the c eclipse platform Click on the x 3 Go to File New C Project Some machines will have C project If so skip the next two slides If not just select project Click on File New C Project 4 2 Expand Executable from Project Types by clicking on the Select Empty project from Project Types Select MinGW GCC from Toolchain Select a Project Name for this lab type Eclipse Lab Click Finish Give it a Project Name For now use Eclipse Lab Make sure this is checked MinGW GCC Empty Project Click on the Next to Executable Make sure this is checked 5 Creating a C Source File Go to File New Source File File New Source File 6 3 Creating a source file Enter main cpp in the name finish Make sure this matches your project name Type in main cpp Your source file Has to end with cpp stands for c plus plus 7 Type the code on the next slide into the main cpp window Make sure you hit return enter after the Main cpp 8 4 Fill in the header box here with YOUR appropriate Information ie name lab class etc AUTHOR STUDENT ID LAB 0 Eclipse Lab CLASS SECTION DUE DATE include iostream include iomanip using namespace std Type this program in EXACTLY as you see it here EXCEPT the changes specified by the purple boxes int main CONSTANTS PROGRAMMER Programmer s Name CLASS Student s Course SECTION Class Days and Times LAB NUM Lab Number specific to this lab LAB NAME Title of the Lab const char PROGRAMMER 30 Michele Rousseau const char CLASS 5 CS1A const char SECTION 25 MW 7 30a 12 00p const int LAB NUM 5 const char LAB NAME 17 Eclipse Tutorial cout cout cout cout cout cout cout cout Replace my info in this section with YOUR info your name in quotes your class and section and the proper lab left n PROGRAMMED BY PROGRAMMER n setw 14 CLASS CLASS n setw 14 SECTION SECTION n LAB setw 9 LAB NUM LAB NAME n n n right return 0 9 Make sure you save before every build Save The means you need to save You can expand any window by clicking on this icon on the window you want to expand This may make It easier for You to see your code As you type it in 10 5 You can reduce the window here No means it has been saved Change these To your name the correct date your student id class section and the correct Lab MAKE SURE you hit the enter key after the Remember C is case sensitive 11 Building a C Project Compiling your code Build compiles your code from C to machine language it makes your code executable by the computer ctrl B to build the project or go to Project Build All Make sure you save first Project Build All Note This window must be active Click on it 12 6 Any errors will show up in the console window at the bottom of the perspective The console Will show if there are any errors The Build complete for project line indicates there were no errors Problems will show you the same errors in a different format If you have errors double check that you have not made any typos Errors will be indicated in your code by a red circle with an x in it Check the line above the circle too Make sure you aren t missing any semi colons 13 Running a C Application If code has compiled properly You got the build complete message You are ready to build First Click on the source file window Click on Run Run as 2Local C C Application In this case main cpp Run As 2Local C C Application Note This window must be active Click on it 14 7 Run Program If you have errors you will get a launch failed no binaries Otherwise the results will display in the console window Go back and fix your errors Console Output You can expand this a bit By clicking on the edge and dragging up 15 Displaying Line Numbers and Print Margins Line numbers help with debugging Margins make sure your code doesn t word wrap Line numbers should be displayed for all programs and output in this class Set it to 75 Right Click Here On the left gray margin of your main cpp Select Preferences 16 8 Expand these Left click to check Show Print Margin Change this to 75 Left click to check Show line numbers Click OK 17 To Print your Output Eclipse won t allow you to print from the console You can print from the editor where main cpp is 1 Create a File 2 Copy and Paste the output to the file 3 Print the file 18 9 1 Create a File 1 Right click on the project folder 2 Select New 3 Left Click File 19 1 Create a File con t 1 Give it a name e g ScreenIO txt 2 Click on Finish 20 10 Don t worry your your Screen IO into the File Copy main cpp and Paste is still here ScreenIO txt 2 Paste your output here Click here ctrl v to pase Your new file will Show up here 1 Copy your output from here ctrl a to select all ctrl c to copy 21 Print and Exit Print 1 Click on File Select File Print Click on the tab for main cpp Select File Print To Exit from Eclipse Select File Exit 2 Click on Print 3 Repeat the process for main cpp 4 Click on File Exit 22 11


View Full Document

Saddleback CS 1B - Eclipse Tutorial

Download Eclipse Tutorial
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Eclipse Tutorial and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Eclipse Tutorial and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?