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-34
Running the C/C++ Compiler and Linker
sqlstate
issues a warning if SQLSTATE is undeclared or not declared as char
SQLSTATE[6] in the Declare section.
both
issues warnings if either or both SQLCODE and SQLSTATE are undeclared or
not declared as long SQLCODE and char SQLSTATE[6] respectively in the
Declare section.
-f
specifies whether to reduce size by one or not for the null terminator of the
character type descriptor. The default value is CHAR_AS_STRING. The following
rules apply:
CHAR_AS_STRING – reduces the size by one from the value specified in the
variable declaration.
CHAR_AS_ARRAY – retains the size specified in the variable declaration.
Example—mxsqlc
Run the SQL/MX C/C++ preprocessor using the mxsqlc command. This C++ example
creates an annotated source file and module definition file:
mxsqlc sqlprog.ecpp -c sqlprog.cpp -x -m sqlprog.m -p \
-g moduleGroup=INVENTORY -g moduleVersion=V2
This C++ example creates a single-file 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
Running the C/C++ Compiler and Linker
The HP NonStop C/C++ compilers translate source code into machine language that is
specific to a particular NonStop system architecture. The type of C/C++ compiler that
you use to compile your SQL/MX program determines the NonStop system and
environment where you can run the program.
Table 15-1 on page 15-35 lists the C/C++ compilers, the environments where you can
run the compilers, and the environments where you can run the compiled programs.
Note. TNS/R native compilation tools are available on systems running H06.05 or later RVUs.