Getting Started with HP aC++

Choose from the following for introductory information:


Major Components of the Compiling System

HP aC++ includes the following pieces:

For More Information


Using the aCC Command

To invoke the HP aC++ compiling system, use the aCC command at the shell prompt. The aCC command invokes a driver program that runs the compiling system according to the filenames and command line options that you specify.

For More Information:


Compiling a Simple Program

The best way to get started with HP aC++ is to write, compile, and execute a simple program, like the following one:

#include <iostream.h> int main() { int x,y; cout << "Enter an integer: "; cin >> x; y = x * 2; cout << "\n" << y <<" is twice " << x <<".\n"; }

If this program is in the file getting_started.C, compiling and linking the program with the aCC command produces an executable file named a.out:

$ aCC getting_started.C

Executing the Program

To run this executable file, just enter the name of the file. The following summarizes this process with the file named getting_started.C:

$ a.out
Enter an integer: 7

14 is twice 7.


Debugging Programs

You can use the HP WDB Debugger or the HP/DDE Debugger to debug your C++ programs.

To do so, first compile your program with either the -g, the -g0, or the -g1 option.

Example

The -g0 option to aCC enables generation of debug information:
aCC -g0 program.C

The gdb command runs the HP WDB Debugger in terminal interface mode:

gdb -tui -xdb a.out

The dde command runs the HP/DDE Debugger:

dde a.out