Introduction to Software Lab

Teague Sterling & Gurgen Tumanyan

Week 0 — Spring 2010

Course Information

Instructors

Office: SCI 252 (Next to Comptuer Science Under Grad. Lab)

Course Structure

Requisite Software

Getting Started with Netbeans

  1. Download Netbeans
  2. Download/Install Cygwin (Windows Users Only!)
  3. Install Netbeans
  4. Run Netbeans

That was easy. No? If you had problems the next few slides should help.

Did it Work?

E-mail us or come to office hours if things are broken, otherwise continue on.

Setting Up NetBeans

  1. Open the NetBeans, and in the "Tools" menu click on "Options".
  2. Click on "C/C++" icon. You should see the "Build Tools" tab.
  3. Click then "Add" on the left. You should see "Add new tools collection".
  4. Click "Browse" and go to you cygwin installation directory (typically: C:/cygwin/)
  5. Select the "bin" subdirectory and click OK button. You should see "Cygwin" in Tool Family drop down box; click OK
  6. The fields on the right filled should be filled out and along with anew entry in the left hand list. Select this and set it as the default.

Did it really Work?

At this point, try to build your project by clicking the hammer icon in the upper panel. If everything's cool you'll see "Build Successful" message in the output window.

Now run your program by clicking the green "Play button". If a black window opens saying "Hello World", then congrats :-D. (Don't worry for now if there is other junk in the window).

If anything else happened please come to office hours so we can help get you up and running.

Makin' Programs

Projects are not at all required, but will make your life easier later on.

Creating a Project

  1. Click "File" ยป "New Project"
  2. Select "C/C++" under "Categories" and "C/C++ Application" under "Projects". Click Next
  3. Give the Project a unique name. Let's call it "HelloCSC211"
  4. Change the Project location if you feel so inclined
  5. Make sure "Create Main File" is checked with "C++" selected in the drop-down menu.
  6. Click "Finish"

Working with Projects

Writing Your First Program

Type the following in the text editor:

/* Project: HelloCSC211
 * File:    main.cpp
 * Author:  <YOUR NAME HERE>
 * Created: January 27, 2010  2:30 PM
 */  
#include <iostream>

using namespace std;

int main () {
    cout << "Hello, World!" << endl;
    return 0;
}

Compiling Your First Program

You're Done