Using Quincy 2005
Using Quincy 2005 to write a C++ program
Single-file programs
Programming exercises need only one file, so we describe this situation first. Later, you may well need to use
Quincy’s “project” mechanism to build a more complex application.
• Start Quincy 2005 (on P6/P9 PCs it is under Start | Programs | School of Physics and Astron-
omy | Quincy 2005 ). You may wish to make a desktop shortcut for this.
• Select File | New... | C++ Source File.
• Select File | Save As, inventing a name for the program; here we use the example myapp. Save on your
network disk drive as myapp.cpp . Beware: anything you save on the local hard disk will be erased at
the end of your session!
This should produce an empty C++ file called myapp.cpp in an editor window. To reopen this file in future,
use File | Open.
Entering and running a program
Edit away until you have the program below.
// A simple C++ program
#include <iostream>
using namespace std;
int main() {
cout < < "Hello world" < < endl;
}
To run, use either Project | Execute, the running icon on the toolbar, or the F9 key. If the program is new or has
been changed in any way, you will be asked if you want to build (compile) it. Answer yes. The Build window
shows how the compilation is proceeding.
If everything is OK, a console window should open, with the "Hello world" message printed in it. Press a
key to close the window. Do not use the window’s close (X) button, as this will close Quincy as well.
In case of errors...
If there are errors in the program, it will not run. Instead, messages will appear in the Build window. Find the
first error that refers to your program, e.g. myapp.cpp:4: somesuch error. Click on the error to move
the editor cursor to the line it complains about. Fix the error and run again. Note: errors confuse the compiler,
so the messages may be only an approximation to the real problem! Do not attempt to alter any code that you
did not write: errors that appear to be in the system library code are a symptom of a problem in your own code.
Editor commands
Quincy has rather few editing commands. Here are some useful ones.
Ctrl C, Ctrl V, Ctrl X, Ctrl Z copy / paste / cut / undo
Home, End move to start/end of line
Shift Home, Shift End select to start/end of line
Ctrl Home, Ctrl End move to start/end of file
Ctrl Shift Home, Ctrl Shift End select to start/end of file
Ctrl { jump to matching { or }
Multi-file Projects and FLTK GUI programs
See the Quincy on-line user’s guide (“Working with projects”) in the Quincy Help menu. For FLTK, Select the
FLTK option in the Project properties, and add the appropriate #include<FL/xxx.H> lines to your cpp file.
Year 3: Introduction to C++ 20050927