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 COBOL—544617-003
15-63
Building SQL/MX Guardian Applications in the
Guardian Environment
== Call the NMCPLUS compiler to generate the object file.
TACL> nmcplus/in progsrc,out progout/progo;version2
== Call the nld linker to generate an executable file.
TACL> nld $system.system.crtlmain progo -o progexe -obey &
$system.system.libcobey -lzclisrl -lzcplsrl &
-lztlhsrl -noverbose
6. Execute the executable:
TACL> run progexe
Using a TACL Macro to Build a C++ Guardian Application
Use a TACL macro file to combine and execute the commands. Use these sample
TACL macros to customize your own script. In the samples, the source file is located in
the Guardian environment and named progecpp. Remember that the source file must
be Guardian file code 101.
For TNS/E native compilation:
?tacl macro
param home /G/myvol/mysubvol
== Store terminal information in file templog.
== The source file must be file code 101.
== Call the SQL/MX preprocessor.
osh -c "mxsqlc progecpp -c progcpp -m progm ~|tee templog"
== Call the SQL/MX compiler.
osh -c "/G/system/system/mxcmp progm ~|tee -a templog"
== Convert OSS text files (file code 180) to Guardian text files
== (file code 101).
sink [#purge proglog]
ctoedit templog,proglog
ctoedit progcpp,progsrc
== Call the CPPCOMP compiler to generate the object file.
cppcomp/in progsrc,out progout/progo;version2
== Call the eld linker to generate an executable file.
eld $system.system.ccplmain progo -o progexe &
-lzcppcdll -lzcpp2dll -lzcredll -lzcrtldll -lzosskdll &
-lzi18ndll -lzicnvdll -lzclidll -lztlh7dll
== Execute the executable.
run progexe
For TNS/R native compilation:
?tacl macro
param home /G/myvol/mysubvol
== Store terminal information in file templog.
== The source file must be file code 101.
== Call the SQL/MX preprocessor.
osh -c "mxsqlc progecpp -c progcpp -m progm ~|tee templog"
== Call the SQL/MX compiler.
osh -c "/G/system/system/mxcmp progm ~|tee -a templog"
== Convert OSS text files to Guardian text files.
sink [#purge proglog]
ctoedit templog,proglog










