beautypg.com

A sample odbc application, Compiling and linking the sample application, Example for compiling a threaded application – HP Integrity NonStop H-Series User Manual

Page 53: Appendix a: sample odbc application

background image

A Sample ODBC application

Compiling and linking the sample application

HP-UX

Use the g++ compiler to compile the application with the header files that are shipped along
with the driver:

odbc]$ g++ -m64 -o < output object name > -I < location of the header
files > \

< input file for compilation > -l mxodbc_ia64

Linux 32

Use the g++ compiler to compile the application with the header files that are shipped along
with the driver:

odbc]$ g++ -m32 -o < output object name > -I < location of the header
files > \

< input file for compilation > -l mxodbc

Linux 64

Use the g++ compiler to compile the application with the header files that are shipped along
with the driver:

nl

odbc]$ g++ -m64 -o < output object name > -I < location of the header files > \
< input file for compilation > -l mxodbc64

OSS

Use the c89 compiler to compile the application with the header files that are shipped along
with the driver:

oss> c89 -o < output object name> -I/usr/include/odbc/ \

-c < input file for compilation >

By default, the header files are located in the /usr/include/odbc directory.

Example for compiling a threaded application

HP-UX

The following is a sample compilation command:

odbc]$ /usr/bin/g++ —m64 I < path for include files >

ThreadODBCTestAppl.c -o ThreadODBCTestAppl —l mxodbc_ia64

Linux 32

The following is a sample compilation command for a 32–bit application:

odbc]$ /usr/bin/g++ -m32 -I < path for include files >

ThreadODBCTestAppl.c -o ThreadODBCTestAppl —l mxodbc

Linux 64

The following is a sample compilation command for a 64–bit application:

odbc]$ /usr/bin/g++ -m64 -I < path for include files >
ThreadODBCTestAppl.c -o ThreadODBCTestAppl —l mxodbc64

OSS

The following is a sample compilation command for a 32–bit application:

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 \

Compiling and linking the sample application

53

This manual is related to the following products: