SQL/MX Programming Manual for C and COBOL (H06.10+, J06.03+)

C/C++ Program Compilation
HP NonStop SQL/MX Programming Manual for C and COBOL544617-003
15-46
c89 Examples With Module Definition Files
sqlprog.c to produce the executable file, sqlprog.exe. The SQL/MX compiler
command -Wmxcmp processes the module definition file sqlprog.m with the
SQL/MX compiler, mxcmp, to produce the module.
This command preprocesses several C++ source files and compiles them, but it
does not link the results:
c89 -c -Wsqlmx -Wsqlmxadd=-x file1.eC file2.ecc file3.ec++
If no errors are detected in either the preprocessing or compiling steps, these files
are created: file1.m, file1.C, file2.m, file2.cc, file3.m, file3.c++,
file1.o, file2.o, and file3.o. TNS/E compilation also produces these files:
file1.dep, file2.dep, and file3.dep.
To compile the preprocessed source file named sqlprog.cpp without linking:
c89 -I /usr/tandem/sqlmx/include -c sqlprog.cpp -o \
sqlprog.exe
The -I option indicates the path for the Platform.h file.
If you have multiple source files, you must compile each source file before linking
them. For example, this c89 command compiles the preprocessed source files
named sqlprog1.c and sqlprog2.c and links them to create an executable file
named sqlprog.exe:
c89 -I /usr/tandem/sqlmx/include sqlprog1.c sqlprog2.c \
-o sqlprog.exe
If you did not link your object files by using the c89 utility, create the executable
program by using the native object file linker to link one or more object files.
°
For example, this eld command links sqlprog1.o and sqlprog2.o to
create an executable file named sqlprog.exe:
eld /usr/lib/ccplmain.o sqlprog1.o sqlprog2.o \
-o sqlprog.exe -lzcredll -lzcrtldll -lzosskdll \
-lzicnvdll -lzclidll
For more information on eld, see the eld Manual.
°
For example, this nld command links sqlprog1.o and sqlprog2.o to
create an executable file named sqlprog.exe:
nld sqlprog1.o sqlprog2.o -o sqlprog.exe
For more information on nld, see the nld Manual.