HP C A.06.05 Reference Manual

Compiling and Running HP C Programs
Compiling HP C Programs
Chapter 9 221
cc prog.c -co /users/my/prog.o
compiles the source file prog.c and places the object file prog.o in /users/my/prog.o.
cc -Wp,-H150000 p1.c p2.c p3.c -o p +legacy_cpp
compiles the source files in the option -H150000 to the preprocessor cpp to increase the
define table size from the default.
cc -Wl,-vt *.c -o vmh
compiles all files in the working directory ending with .c, passes the -vt option to the
linker, and causes the resulting program file to be named vmh.
cc -vg prog.c
compiles prog.c, adds debug information, and displays the steps in the compilation
process.
cc -S prog.c
compiles the file prog.c into an assembly output file called prog.s.
cc -OAa prog.c
compiles prog.c in ANSI mode and requests level 2 optimization.
cc +O1 prog.c
compiles prog.c and requests level 1 optimization.
cc +w1 prog.c -c
compiles prog.c with low-level warnings emitted and suppresses linking.
cc -D BUFFER_SIZE=1024 prog.c
passes the option -D BUFFER_SIZE=1024 to the preprocessor, setting the value of the
macro for the compilation of prog.c.
cc prog.c -lm
compiles prog.c requests the linker to link the library /usr/lib/hpux32/libm.so with
the object file prog.o to create the executable a.out.
cc -L/users/devel/lib prog.c -lme
compiles prog.c and causes the linker to search the directory /users/devel/lib for the
library libme.a, before searching in /usr/lib/hpux32.
cc +DD32 +Z -c prog.c
compiles prog.c for use in a large shared library in 32-bit mode.