SQL/MX 3.2 Programming Manual for C and COBOL (H06.25+, J06.14+)

C/C++ Program Compilation
HP NonStop SQL/MX Release 3.2 Programming Manual for C and COBOL663854-002
15-26
Windows-Hosted SQL/MX C/C++ Preprocessor
This C++ example creates a self-contained, annotated output source file that contains
an embedded module definition:
mxsqlc sqlprog.ecpp -c sqlprog.cpp -g moduleTableSet=TEST1
This C++ example creates an annotated source file and module definition file for 64-bit
compilation.
Mxsqlc sqlprog.ecpp -c sqlprog.cpp -x -m sqlprog.m -p -U 64
Windows-Hosted SQL/MX C/C++ Preprocessor
The Windows hosted SQL/MX C/C++ preprocessor is a DLL file named
mxsqlcnt.dll and is accompanied by a DLL loader named mxsqlc.exe. These
files are installed in the C:\Program Files\HP SQL-MX C Preprocessors
directory. Use either the command shell or the Korn shell to run the preprocessor with
the RUN command. You can also use ETK to build a C or C++ program. For more
information, see Building a C/C++ Program With Embedded SQL Statements on
Windows on page 15-55.
You can install multiple versions of the SQL/MX C/C++ preprocessors. The
environment variable MXSQLC enables you to select a particular version of the SQL/MX
C/C++ preprocessor for C/C++ compilations.
For example, to select the SQL/MX C/C++ preprocessor in the
C:\PROGRA~1\HPSQL-~1\ directory, set MXSQLC from the Windows command line:
set MXSQLC=C:\PROGRA~1\HPSQL-~1\mxsqlcnt.dll
You can also set the environment variable in the Windows system properties. If
multiple versions of the SQL/MX C/C++ preprocessors are installed and if MXSQLC is
not set, the latest version of the SQL/MX C/C++ preprocessor installed on the system
is used for compilations, by default.
If you use INVOKE, MXCS must be installed on your operating system to provide the
necessary communication between your client workstation and the server. For more
information on how to install MXCS, see the SQL/MX Connectivity Service
Administrative Command Reference. In addition, you must install the HP NonStop
ODBC/MX driver for Windows. For installation information, see the ODBC/MX Driver
for Windows Manual.
The SQL/MX C/C++ preprocessor 2.3 can be invoked by a user or by a cross compiler,
or by an Integrated Development Environment (IDE). For each scenario, the SQL
preprocessor invoked is:
Note. On systems running H06.14 RVU and later, the SQL/MX C/C++ compilations select the
latest version of the SQL/MX C/C++ preprocessors installed on the system.
On systems running H06.13 RVU and earlier, the SQL/MX C/C++ compilations use the earliest
version of the SQL/MX C/C++ preprocessor installed on the system.