Open System Services ODBC/MX Client Driver Manual for SQL/MX Release 3.2.1 (H06.26+, J06.15+)
A Sample ODBC Application
Compilation and Linking of the Sample ODBC Application
• Sample Application compilation step:
Use the c89 compiler to compile the application with the header files that are shipped along
with the OSS ODBC/MX Client Driver:
OSS> c89 -o < output object name> -I/usr/include/odbc/ \
-c < input file for compilation>
By default, the header files are located at the /usr/include/odbc/ directory.
Example A-1. Example for compiling a threaded program
A sample compilation command for a 32–bit user application is:
OSS> c89 -g -Winspect -Wextensions -Ww -Woptimize=0 \
-Wsystype=oss -Wrefalign=8 -Wfieldalign=auto \
-Wallow_cplusplus_comments -Wcplusplus -Wversion3 \
-Wtarget=tns/e -DYOSEMITE -Wcall_shared \
-D__GNUC__ -DOSS_DRIVER -D_DEBUG -DNSK_PLATFORM \
-DTCL_MEM_DEBUG -D__TANDEM -Dset_fieldalign \
-D_TNS_R_TARGET -WIEEE_float -I/usr/include/odbc \
-c ThreadODBCTestAppl.c -o ThreadODBCTestAppl.o
A sample compilation command for a 64–bit user application is:
OSS> c89 -g -Winspect -Wextensions -Ww -Woptimize=0 \
—W lp64 —Wsystype=oss -Wrefalign=8 -Wfieldalign=auto \
-Wallow_cplusplus_comments -Wcplusplus -Wversion3 \
-Wtarget=tns/e -DYOSEMITE -Wcall_shared —D_PUT_MODEL_\
-D__GNUC__ -DOSS_DRIVER -D_DEBUG -DNSK_PLATFORM \
-DTCL_MEM_DEBUG -D__TANDEM -Dset_fieldalign \
-D_TNS_R_TARGET -WIEEE_float -I/usr/include/odbc \
-c ThreadODBCTestAppl.c -o ThreadODBCTestAppl.o
NOTE: For C programming applications, add -Wallow_cplusplus_comments flag in the
compile step.
• Sample Application linking step:
Use the eld linker to link the application with the OSS ODBC/MX Client Driver (ZODBCDLL).
By default, the driver is located at the $SYSTEM.ZMXODBC location.
Example A-2. Example for linking a threaded program
A sample linker command for a 32–bit application is:
OSS> eld -o ThreadODBCTestAppl -verbose -Bdynamic \
-set systype oss -set FLOATTYPE IEEE_FLOAT -call_shared \
-set highpin on -set highrequestor on \
-lcpp3 -lcppc -lcrtl -lcre -linet -lzsptdll \
-l<Location of zodbcdll>/zodbcdll /usr/lib/ccplmain.o ThreadODBCTestAppl.o
ThreadODBCTestAppl.o
A sample linker command for a 64–bit application is:
OSS> eld -o Thread_PUT_Test -verbose -Bdynamic \
Compilation and Linking of the Sample ODBC Application 53










