Index


RISC World

Easy C++ Manual

Copyright © ProAction and APDL, 2001

Getting Started

Being a program compiler, we took the decision to insist upon hard disc installation for this version of Easy C++. We opted for CD-ROM presentation instead of floppy disc, as a CD-ROM allows us to place numerous support materials in addition to the program in a single, convenient, location.

Installation of Easy C++

The Easy C++ disc contains an installation application, which will copy to the specified location on your hard disc the required components of the Easy C++ package. It is fully self-sufficient, and installs to your hard disc everything you'll need to run Easy C++ on a day to day basis.

Some support materials will remain on the CD-ROM.

Compiling and running a simple program

The instructions given below describe how to compile, link and run a simple C program. It is assumed that users with hard discs have installed Easy C according to the previous instructions.

Step 1 - Run Easy C++

Click on the hard disc icon on the icon bar, double-click on the C directory to open it, then double-click on !EasyC. Easy C will now be installed on the icon bar.

If you on occasion see a 'C' logo, rather than 'C++', this is entirely due to historical aspects of this package: Easy C operates identically to Easy C++.

Step 2 - Open the Easy C dialogue box

Click Select on the Easy C icon on the icon bar to open the following dialogue box.

Step 3 - Load the C program to be compiled

For the purpose of this example we will compile an existing C program rather than write a new one. The C program to be compiled is called HelloW, and can be found in the Programs directory of the CD-ROM.

Drag the file HelloW into the window labelled Source in the dialogue box.

Step 4 - Compile the program HelloW

Click on Compile to compile HelloW. The Status box at the bottom of the dialogue box will display the message Compiling, and the green bar will indicate the progress being made. Other icons in the dialogue box will be explained later and may be ignored for now.

When HelloW has been compiled, the Status box shows the message Compilation Complete.

Step 5 - Link HelloW to the standard libraries

The compile action in step 4 generated an object file called HelloW which is shown in the Object window.

Now click on Link to link the object file to the standard libraries. This procedure links HelloW with any external functions it uses, and converts the object code into executable machine code. The Status box confirms that linking is taking place and displays the message Linking Complete when complete.

Step 6 - Running HelloW

The final machine code program is called HelloW, and is stored in the Programs.General directory i.e. the directory that contains the c and o directories. Double-click on it to run it. This simple program prints the message Hello, world in a window on the screen.

Remember that if the error message Shared C library not loaded is displayed, you will have to run another program such as Easy C or Edit to load the modules, or use a proper !Run file. A !Run file prepares the system for the program you are loading: take a look at the Easy C run file for an example.

Step 7 - Compiling further programs

There are some more programs in directory Programs.General.c which you may wish to compile and run. Try compiling Spheres, Grep or Sieve.

However, first you must clear the Source and Object windows of any previous files i.e HelloW. To do this, hold down Ctrl and drag a new source file, such as Spheres, into the Source window. This procedure will load the new file, clearing any previous files first. Alternatively, drag it to the Easy C icon on the icon bar to load it and clear both Source and Object windows at the same time.

Compiling C++ programs

The procedure for compiling C++ programs is identical to that described above. To ensure that it works, use the Advanced Setup option from the Easy C++ menu to check C++ is being compiled rather than C.

APDL and ProAction

 Index