HP aC++/HP C A.06.25 Programmer's Guide
Examples of the aCC Command
Following are some examples of the aCC command:
Compiling and Renaming an Output File
aCC -o prog prog.C
This command compiles prog.C and puts the executable code in the file prog, rather
than in the default file a.out.
Compiling and Debugging
aCC -g prog.C
This command compiles prog.C and includes information that allows you to debug
the program with the HP WDB debugger, wdb.
Compiling Without Linking
aCC -c prog.C
This command compiles prog.C and puts the object code in the file prog.o. It neither
links the object file nor creates an executable file.
Linking Object Files
aCC file1.o file2.o file3.o
This command links the listed object files (file1.o, file2.o, and file3.o) and
puts the executable code in the file a.out.
NOTE: You must use the aCC command to link your HP aC++ programs and libraries.
This ensures that all libraries and other files needed by the linker are available.
Compiling, Optimizing, and Getting Verbose Information
aCC -O -v prog.C
This command compiles and optimizes prog.C, gives verbose progress reports, and
creates an executable file a.out.
Compiling and Creating a Shared Library
aCC +z -c prog.C
aCC -b -o mylib.sl prog.o
The first line compiles prog.C, creates the object file prog.o, and puts the
position-independent code (PIC) into the object file. The second line creates the shared
library mylib.sl, and puts the executable code into the shared library.
32 Getting Started with HP aC++