Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)
User Commands (c) c89(1)
8. The command
c89 -Wsqlmx -Wmxcmp -o sqlprog.exe sqlprog.ec
causes the following steps to be performed:
a. c89 invokes the NonStop SQL/MX preprocessor, mxsqlc. mxsqlc takes the file
sqlprog.ec (consisting of a single C module with embedded NonStop SQL/MX
information) as input and produces two files: sqlprog.c and sqlprog.m.
sqlprog.c is the C-only equivalent of sqlprog.ec; that is, NonStop SQL/MX
statements are translated to the appropriate C code. sqlprog.m is the
corresponding MDF.
b. If there are no errors in Step a, c89 invokes the C compiler to compile sqlprog.c,
creating the object file sqlprog.o.
c. If there are no errors in Step b, c89 invokes the NonStop SQL/MX compiler to
process the MDF file sqlprog.m.
d. If there are no errors in Step c, c89 invokes nld to link sqlprog.o with the C stan-
dard library and produce the executable file sqlprog.exe.
9. The command
c89 -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 compila-
tion steps, the following files are created: file1.m, file1.C, file2.m, file2.cc, file3.m,
file3.c++, file1.o, file2.o, file3.o.
10. The command
c89 -Wsqlmx -E file.ec > file-cpp.c
uses the mxsqlc preprocessor to expand embedded SQL statements and invokes the Non-
Stop SQL/MX preprocessor to create a single source file containing only C statements.
11. The command
c89 -c -Wsqlmx file1.C file2.ecc file3.ec++ file4.cpp
illustrates mixing C++ source files, with and without NonStop SQL/MX information, 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 preprocessing or compilation steps, the following
files are created: file2.m, file2.cc, file3.m, file3.c++, file1.o, file2.o, file3.o, file4.o.
12. The command
c89 -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 mxCompileUserModule without
also linking it.
13. The following command on a TNS/R system
c89 -Wsrl -Wnld=-ul -o mylib mylib.c
compiles the source file mylib.c and links the object file to create a native user library, a
special shared run-time (SRL) library. The file is named mylib in the current working
directory.
527188-007 Hewlett-Packard Company 2−29