SQL/MX Programming Manual for C and COBOL (G06.24+, H06.03+)
C/C++ Program Compilation
HP NonStop SQL/MX Programming Manual for C and COBOL—523627-004
15-6
Compiling Embedded SQL C/C++ Programs With
Module Definition Files
Compiling Embedded SQL C/C++ Programs With Module
Definition Files
Figure 15-2 shows how a C/C++ program with separate module definition files is
compiled. The application’s embedded SQL source file is called sqlprog.sql.
Although this figure shows individual steps for clarity, you can use the c89 utility or
ETK to automate the process. For more information on using c89 in this way, see c89
Utility: Using One Command for All Compilation Steps on page 15-34. For more
information on ETK, see ETK online help.
These steps correspond to the steps in Figure 15-2 on page 15-6.
Figure 15-2. Compiling Embedded SQL C/C++ Programs With Module Definition
Files
SQL/MX
C/C++ Source File
sqlprog.sql
SQL/MX
C/C++ Source File
sqlprog.sql
SQL/MX
C/C++ Preprocessor
(mxsqlc)
SQL Module
Definition File
sqlprog.m
SQL Module
Definition File
sqlprog.m
SQL/MX Compiler
(mxcmp)
C/C++ Annotated
Source File
sqlprog.c or
sqlprog.cpp
C/C++ Annotated
Source File
sqlprog.c or
sqlprog.cpp
2
3
3
C/C++ Compiler
4
1
8
vst142.vsd
SQL/MX Module
SQL/MX Module
Object File
sqlprog.o
Object
Libraries
Linker
5
6
Application Process
sqlprog.exe
SQL CLI and Executor
C/C++ Program
(executable) File
sqlprog.exe
C/C++ Program
(executable) File
sqlprog.exe
7
9