Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Itanium-based Systems: HP aC++/HP C Programmer's Guide > Chapter 1 Getting Started with HP aC++

Components of the Compilation System

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

The HP aC++ compiling system consists of the following components:

aCC

The aCC driver is the only supported interface to HP aC++ and to the linker for HP aC++ object files.

cc

cc is the HP-UX C compiler.

c89

c89 is the HP-UX ANSI-conforming C89 compiler.

c99

c99 is the HP-UX ANSI-conforming C99 compiler.

ecom

The ecom compiler (for A.06.*) compiles the C++ source statements. Preprocessing is incorporated into the compiler.

ctcom

The ctcom compiler (for A.05.*) compiles the C++ source statements. Preprocessing is incorporated into the compiler.

The other HP aC++ executable files are:

C++filt

C++filt is the name demangler. It implements the name demangling algorithm which encodes function name, class name, and parameter number and name.

ld

ld is the linker. It links executables and builds shared libraries.

HP aC++ Runtime Libraries and Header Files:

Standard C++ Library


/usr/lib/hpux32/libstd.s0 (32-bit shared version)
/usr/lib/hpux32/libstd.a  (32-bit archive version)
/usr/lib/hpux64/libstd.s0 (64-bit shared version)
/usr/lib/hpux64/libstd.a  (64-bit archive version)

HP aC++ Runtime Support Library


/usr/lib/hpux##/libCsup.s0
/usr/lib/hpux##/libstd.s0 and libstd_v2.s0
/usr/lib/hpux##/libstd_v2.s0 and librwtool_v2.s0
/usr/lib/hpux##/libstream.s0
Libraries in /usr/include/hpux##

(where ## is 32 or 64 provided as part of the HP-UX core system)

Standard C++ Library


/usr/lib/hpux32/libstream.s0 (32-bit shared version)
/usr/lib/hpux32/libstream.a  (32-bit archive version)
/usr/lib/hpux64/libstream.s0 (64-bit shared version)
/usr/lib/hpux64/libstream.a  (64-bit archive version)

Header files for these libraries are located at /opt/aCC/include/.

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.

Compiling a Simple Program

The best way to get started with HP aC++ is to write, compile, and execute a simple program, as shown in the following example:

#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 getting_started.C:

$ a.out

  Enter an integer: 7

  14 is twice 7.

Debugging Programs

You can use programming and debugging aides.

HP Code Advisor

HP Code Advisor is a code checking tool that can be used to detect programming errors in C/C++ source code. Use "/opt/cadvise/bin/cadvise" to invoke the tool. A brief description is available with the -help option.

$ /opt/cadvise/bin/cadvise -help

Additional information is available at: http://www.hp.com/go/cadvise/

HP WDB Debugger

You can also use the HP WDB debugger to debug your C++ programs after compiling your program with either the -g, the -g0, or the -g1 option.

Example:

The -g0 option enables generation of debug information:

$ aCC -g0 program.C

The gdb command runs the HP WDB debugger:

$ gdb a.out

For more information on the HP WDB debugger, refer to “Debugging Options”.

Accessing Online Example Source Files

Online example source files are located in the directory /opt/aCC/contrib/Examples/RogueWave. These include examples for the Standard C++ Library and for the Tools.h++ Library.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.