|

Easy C++ Manual
Copyright © ProAction and APDL, 2001
Getting started
To use Easy C from the command line, run it in the usual way, then press F12
to go to the command line. You may wish to save memory by quitting the Easy
C application from the icon bar first. Loading Easy C also loads the C
module called EasyC, which contains the compiler, linker and library facility. You can get help
about this module by entering:
*help easyc
The version number for the module is displayed with this information, and
should be quoted in any correspondence with the publisher about this program.
Help on the Compiler, Linker and Library facility can be found using the
following commands:
*help cc
*help link
*help library
These show the general command syntax, the optional qualifiers, and the
default parameters for the commands.
Compiling a simple C program
The following instructions tell you how to compile, link and run a simple C
program from the command line. It assumes that you have loaded the system in
the manner described above, and are in the directory of your hard disc to
which you have installed the program.
1. Change the current directory to the examples directory, by typing:
*dir $.Programs.General
or the equivalent pathname if you are using a hard disc system.
2. To compile the example program HelloW, type:
*cc HelloW
The file HelloW is a C program stored in subdirectory c of the current directory. Notice that we do not specify the directory name since the compiler will automatically look in directory c for it. If all is well, a message will be displayed indicating that the compilation is complete and there were no errors.
3. The compiler produces object code for the program HelloW in subdirectory
o of the current directory. The next step is to link this to the standard
library of functions.
*link HelloW
Note again that we do not need to specify directory o. During linking, C will access the standard library and header files, and generate an executable program called HelloW in the current directory. The * prompt will re-appear when linking is complete.
4. To run HelloW, type:
*HelloW
and the program will print
hello, world
on the screen.
5. Steps 2 to 4 above could be incorporated in one command, thus:
*cc HelloW -run
A few other example C programs are also provided in directory c for you to try.
APDL and ProAction

|