Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)

User Commands (c) c99(1)
compiles the source files foo.c and baz.c and links their respective object files
with bar.o into the object file test3.o. The preprocessor symbol TYPE is
defined to 3, and full optimization is performed by the compiler. The compiler
looks for included files in the directory /usr/friend, then in
/usr/myself/headers, then in /usr/include.
7. The command
c99 -c -Wsqlmx file1.eC file2.ecc file3.ec++
uses the mxsqlc preprocessor on several C++ source files and also compiles
them, but does not link the results. If no errors are detected in either the
preprocessing or compilation steps, the following files are created: file1.m,
file1.C, le2.m, le2.cc, file3.m, file3.c++, le1.o, file2.o, le3.o.
8. The command
c99 -Wsqlmx -E file.ec > file-cpp.c
uses the mxsqlc preprocessor to expand embedded SQL statements and
invokes the NonStop SQL/MX preprocessor to create a single source file con-
taining only C statements.
9. The command
c99 -c -Wsqlmx file1.C file2.ecc file3.ec++ file4.cpp
illustrates mixing C++ source files, with and without NonStop SQL/MX infor-
mation, on a single command line. Only source files that have names with one
of the SQL extension suffixes invoke the mxsqlc preprocessor. However, all
files are compiled but not linked. If no errors are detected in either the prepro-
cessing or compilation steps, the following files are created: file2.m, file2.cc,
file3.m, file3.c++, file1.o, file2.o, le3.o, file4.o.
10. The command
c99 -Wmxcmp -Wmxcmp_files=test1.m,test1.o
SQL-compiles the MDF file test1.m using the NonStop SQL/MX mxcmp
compiler and processes the file test1.o using the NonStop SQL/MX mxCom-
pileUserModule without also linking it.
11. The command
c99 file.c -lc -WBstatic -l archive -WBdynamic -l native
compiles the source file file.c and links the object file into an executable file
a.out in the current working directory. The linker performs dynamic linking by
searching first for the file libc.srl and then libc.a. The linker then performs
static linking by searching for the file libarchive.a. The linker then performs
dynamic linking by searching first for the file libnative.srl and then
libnative.a.
12. The command
c99 file.c -lc -Wcall_shared -WBstatic
-l archive -WBdynamic
-l native
compiles the source file file.c and links the object file into loadfile a.out in the
current working directory. The linker performs dynamic linking by searching
first for the file libc.so and then libc.a. The linker then performs static linking
by searching for the file libarchive.a. The linker then performs dynamic
527188-021 Hewlett-Packard Company 261