Top
Enterprise Postgres 17 SP1 Application Development Guide

Linux3.4.2 Compiling Applications (for Linux)

Specify the following options when compiling applications.

Table 3.1 Include file and library path

Option

How to specify the option

Path of the include file

-I unixOdbc64bitIncludeFileDir

Path of the library

-L unixOdbc64bitLibraryDir

Table 3.2 ODBC library

Type of library

Library name

Dynamic library

libodbc.so

Note

Specify -m64 when creating a 64-bit application.

Example

The following are examples of compiling ODBC applications:

gcc -m64 -I/usr/local/include(*1) -L/usr/local/lib(*1) -lodbc testproc.c -o testproc

*1: This is an example of building and installing from the source without specifying an installation directory for unixODBC. If you wish to specify a location, set the installation directory.