Neoview ODBC Drivers Manual (R2.3)
1. Move to the directory where you installed the sample program:
cd /etc/hpodbc/sample
2. Compile the sample program:
NOTE: All drivers, other than the driver for HP-UX(IA-64) 64–bit and the x86–64 Linux
driver, are 32–bit drivers. Therefore, applications must be compiled accordingly.
• On Linux:
gcc connect_test.cpp -L/usr/lib -I/usr/include/hpodbc \
-lhpodbc -o connect_test
NOTE: The Linux driver is a 32–bit driver. If you are using an x86–64 machine, you
need to explicitly compile your application as a 32–bit application. For example:
gcc connect_test.cpp -m32 -L/usr/lib -I/usr/include/hpodbc \
-lhpodbc -o connect_test
• On x86–64 Linux:
gcc connect_test.cpp -L/usr/lib -I/usr/include/hpodbc \
-lhpodbc -o connect_test
• On HP-UX(IA-64):
aCC -AA connect_test.cpp -L/usr/lib -I/usr/include/hpodbc \
-lhpodbc -o connect_test -lm
NOTE: If you are compiling with a pthreads library, the pthreads library must be the
first library linked. For example:
aCC -AA connect_test.cpp -L/usr/lib -I/usr/include/hpodbc \
-lpthread -lhpodbc -o connect_test -lm
To use cc for compiling and linking:
1. Rename connect_test.cpp to connect_test.c
2. cc connect_test.c -I/usr/include/hpodbc -L/usr/lib \
-lstd_v2 -lCsup -lunwind -lm -lhpodbc -o connect_test
NOTE: If you are compiling with a pthreads library, the pthreads library must
be the first library linked. For example:
cc connect_test.c -I/usr/include/hpodbc -L/usr/lib \
-lstd_v2 -lCsup -lunwind -lm -lpthread -lhpodbc -o connect_test
NOTE: If you are compiling with a pthreads library, the pthreads library must be the
first library linked.
• On HP-UX(IA-64) 64–bit:
aCC +DD64 -AA connect_test.cpp -L/usr/lib/hpux64 -I/usr/include/hpodbc \
-lhpodbc64 -o connect_test -lm
NOTE: If you are compiling with a pthreads library, the pthreads library must be the
first library linked. For example:
aCC +DD64 -AA connect_test.cpp -L/usr/lib/hpux64 -I/usr/include/hpodbc \
-lpthread -lhpodbc64 -o connect_test -lm
To use cc for compiling and linking:
Running the Sample Program 39