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-53
Quick Builds and mxcmp Defaults in a One-File
Application Deployment
These modules use the default mxsqlc option that generates the annotated
output source files s1.c, s2.c, and s3.c.
3. Run the C/C++ compiler:
cd /usr/meas
c89 -Wversion2 -I /usr/tandem/sqlmx/include -c s1.c
c89 -Wversion2 -I /usr/tandem/sqlmx/include -c s2.c
c89 -Wversion2 -I /usr/tandem/sqlmx/include -c s3.c
This step generates the object files s1.o, s2.o, and s3.o.
4. Run the native linker.
For TNS/E native applications, use the eld utility:
cd /usr/meas
eld -verbose /usr/lib/ccplmain.o s1.o s2.o s3.o \
-o sprog.exe -lzcppcdll -lzcpp2dll -lztlh7dll -lzcredll \
-lzcrtldll -lzosskdll -lzi18ndll -lzicnvdll -lzclidll
For TNS/R native applications, use the nld utility:
cd /usr/meas
nld -elf -set systype oss -set highpin off \
-set highrequestor on -set inspect on \
-obey /usr/lib/libc.obey -set saveabend on \
/usr/lib/crtlmain.o s1.o s2.o s3.o \
-l zcplsrl -l zcrtlsrl -l zcresrl -l zcplosrl -l ztlhgsrl \
-l ztlhosrl -Bdynamic -l zclisrl -o sprog
This step generates the application executable object file sprog.
5. Set up needed class MAP DEFINEs (none in this case), and run the SQL/MX
compiler only on the module definitions that have not yet been compiled or that
have changed recently:
mxCompileUserModule -e -v -d CATALOG=harvest -d \
SCHEMA=second \
/usr/meas/sprog {cat.sch.s1m,cat.sch.s2m,cat.sch.s3m}
This step generates plans that reference tables named harvest.second.seeds,
harvest.second.trees, and harvest.second.crops.
6. Set up needed DEFINEs (none in this case), and run and test the program.
sprog
7. Find the next bug and fix the offending source (for example, s1.sql), and repeat
Step 1 to Step 6 for s1.sql only. Specifically, compile only the cat.sch.s1m
module definition in Step 5:
mxCompileUserModule -e -v -d CATALOG=harvest -d \
SCHEMA=second \
/usr/meas/sprog {cat.sch.s1m}