CSCI 240 - Using the Quincy Integrated Development Environment (IDE)

Click here for an animated demo of the material shown below.  Just sit back and watch it.
(Thanks to Prof. Brown)


Many people who haven't used a system like this before find it all somewhat confusing and complicated at first. However, once you've done it a few times it will seem perfectly easy. So don't be concerned if this seems a bit much at first. In a couple of weeks you'll wonder why you were worried.

The IDE is where you will do most of your work in writing, fixing, compiling, running, and debugging your programs. This document will guide you through the steps needed to create and run a simple C++ program.  Debugging will be covered later.

In the CSCI computer lab, start the computer and login to the Network. Your TA (or a lab assistant) will give you instructions.  If you are working at home, just start your computer.

1. Assuming Quincy has been installed on your computer, start Quincy by looking on the Start Button Menu for the Department of Computer Science.  One of the choices will be Quincy.

2. Choose File/New and select C++ Source File. A blank window will pop up.

3. Type in your C++ source code file.  For example,

#include <iostream>

using namespace std;

int main()
{
cout << "hello, world";

return 0;
}

4. Save the file.  Use File/Save.  You will see the pop-up File SaveAs dialog window.  You should select the location where you want your program to be saved.  It could be your a: floppy disk, your c: hard drive (on your own PC), your f: network drive (in the labs) or any subdirectory in any of these locations.  Be sure you know where you are saving the file so you can find it tomorrow.

Choose a meaningful file name with a .cpp extension.  For example, the program above might be named hello.cpp

Notice that once you have saved the file with a .cpp extension, some of the words in your program are now in color.  For example, the blue words are C++ reserved words that have special meanings.  Later, you can set special colors for other kinds of items in your program (e.g. strings, comments) using Tools/Options/Edit.  Doing this is optional.

5. Now compile the program.  Choose Project/Compile. You will see a pop-up window and after a few seconds, the last line should read "Successful build".  If it does not, you have a compile error and the lines displayed in this window will give some information about the location (the line number) and the nature of the error.  You must close the pop-up message window, find and fix all such errors, and re-compile until you get the "Successful build" message.

Once you have the "Successful build" message, Close the pop-up window.

6. Now build the program.  This connects your program to other pre-written code that your program uses (in this example, the code that does the output, cout).  Once again, you should see some lines of information and then the "Successful build" message.  (If you don't see it, you will probably have to get help, but normally, this will not be a problem.)  Click Close to dismiss the pop-up window.

7. Now you can run the program to test it.  Click Project/Execute.  You will see

Depending on the nature of your program, you may see a prompt for user input (which you provide by typing on the keyboard) or some output displayed in the DOS window.  If you typed the program listed above, you will see "hello, world"

8. When the last instruction in your program has executed, Quincy will display the message "Press Enter to return to Quincy".  When you do this, the DOS window will disappear.

Congratulations. You have created and run your first C++ program.

Sit back and relax for 15 seconds... now let's go on.

First a couple of notes on what you have just done. 

When you did Project/Compile and Build and Execute, notice that on the Project menu there are shortcuts shown:  F5 for Compile, F6 for Build, and F9 for Execute. You can use these keys as shortcuts for the corresponding mouse selections.

When you are working in Quincy, you will need to keep track of several windows: we've seen the pop-up windows for Compile and Build, and the DOS window, as well as the window for Quincy itself and the editing window within Quincy where you type and edit your program.  All of these work together and you will need to mentally keep track of which ones are open and where they are (recall, for example, that sometimes the DOS window is minimized as a button on the Task Tray).  Sometimes one window may be hidden behind another.  We assume that you have used Windows enough that you are familiar with the basics of manipulating the various windows.  If not, see one of the 240 TA's during office hours for a brief orientation.

9. Now, just to see what will happen, let's make a couple of mistakes on purpose. Use the delete key to erase the closing " (double quote character) after the word world in your program. Now try to compile it (F5). Notice that the dialog reports several errors. This is common - one mistake may cause several error messages. Your usual response will be to try to fix the first error in your program (which is usually indicated by the first or first few messages) and re-compile. In this case, they all mention something about strings and the " character.  They also mention a line and column number (line 7, column 11  if you typed in the program as shown) which will usually indicate the location of the error.  Read the error messages and note their location(s) and then close the message window.  It is up to you now to find and fix the errors.  Notice that Quincy displays the line and column numbers at the bottom right of the Quincy window to make it easy for you to find the locations mentioned in the error messages.

10. Now try deleting the semicolon at the end of the same line. Compile. You see the same error messages even though we know there are now two errors.  This often happens: one error "hides" another.  Restore the " but leave the ; missing.  Recompile.  Now you see the message "parse error before return".  This means that the compiler couldn't figure out something just before the word return in your program.  It doesn't say that your ; is missing.

11. Restore the ; and change the character string to: "\nhello, world" That's a backslash before the n. Compile build and execute. Notice there is now a blank line at the top of the DOS screen.  The sequence "\n" makes the cursor on the DOS screen go down on line. (Try it again using a forward slash  to see what will happen.)

12. Misspell the word main. Make it "maain". Compile. That should work ok. Try to Build it. Now you will get an error. Read it.  This illustrates two facts: some errors are not detected when you compile the program, and some error messages are not entirely clear.

13. Fix the program, compile and run it again. Now save the corrected new version: Choose File/Save (and notice that pressing the Ctrl-S key is a shortcut to save a file).  You should always do a File/Save to be sure that any any changes to your program are written to disk.

14. (Almost) finally, before you leave, save the program onto a floppy disk.

Note: computers in some labs do not have floppy disks.  If this is the case, ask a lab assistant what options for saving are available.

You will normally want to make a backup (a separate) copy of your work in case the original is lost due to equipment failure (it could happen) or some mistake on your part (also could happen).

First make sure you have a diskette in the computer's disk drive.

Choose File/Save As. In the dialog, under "Save File As" type a:hello.cpp   The file will be written to your diskette in the computer's a: drive.

15. Choose File/Exit to quit your Quincy session and close Quincy. You can then do other work on the computer.  First, though, pretend you have come back (another day maybe) to continue working your program.

16. Start Quincy again. Use File/Open and locate the file you want to work on (i.e. in this case, the one you just saved in step 13 or 14).  Add another line after the first cout line:

cout << "\ngoodbye for now..";

Compile, run, check it, save, and quit.

That's enough for one day.