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-62
Building SQL/MX Guardian Applications in the
Guardian Environment
== Execute the executable.
run progexe
Steps for Building an SQL/MX C++ Application in the
Guardian Environment
Use the next commands at a TACL prompt to preprocess, SQL compile, and compile
and link an SQL/MX C++ program.
1. To make the source file in the Guardian environment accessible to an OSS
process, enter this command, replacing myvol.mysubvol with your default
Guardian volume and subvolume:
param home /G/myvol/mysubvol
The source file named progecpp in $MYVOL.MYSUBVOL must be Guardian file
code 101.
2. To invoke the SQL/MX preprocessor, which is an OSS process, enter an OSS
pass-through command at a TACL prompt:
TACL> osh -c "mxsqlc progecpp -c progcpp -m progm &
|tee templog"
3. To invoke the SQL/MX compiler, which is an OSS process, enter an OSS pass-
through command at a TACL prompt:
TACL> osh -c "/G/system/system/mxcmp progm | tee -a templog"
4. Errors generated by the SQL/MX preprocessor or SQL/MX compiler are logged in
the OSS file templog. To convert the error log to a Guardian file:
TACL> purge proglog
TACL> ctoedit templog,proglog
5. Run the Guardian C++ compiler and linker.
For TNS/E native compilation, you can use either the default C++ library, which is
version3, or version2 in your CPPCOMP compiler command:
== Convert the annotated source file from an OSS text file
== (file code 180) to a Guardian text file (file code 101).
TACL> ctoedit progcpp,progsrc
== Call the CPPCOMP compiler to generate the object file.
TACL> cppcomp/in progsrc,out progout/progo;version2
== Call the eld linker to generate an executable file.
TACL> eld $system.system.ccplmain progo -o progexe &
-lzcppcdll -lzcpp2dll -lzcredll -lzcrtldll &
-lzosskdll -lzi18ndll -lzicnvdll -lzclidll -lztlh7dll
For TNS/R native compilation, you can use either the default C++ library, which is
version3, or version2 in your NMCPLUS compiler command:
== Convert the annotated source file from an OSS text file to
== a Guardian text file.
TACL> ctoedit progcpp,progsrc