Specify the following options when compiling applications.
Architecture | Option | How to specify the option |
---|---|---|
32-bit | Path of the include file | -I unixOdbc32bitIncludeFileDir |
Path of the library | -L unixOdbc32bitLibraryDir | |
64-bit | Path of the include file | -I unixOdbc64bitIncludeFileDir |
Path of the library | -L unixOdbc64bitLibraryDir |
Type of library | Library name |
---|---|
Dynamic library | libodbc.so |
Note
Specify -m64 when creating a 64-bit application. Specify -m32 when creating a 32-bit application.
Example
The following are examples of compiling ODBC applications:
Linux 64-bit
gcc -m64 -I/usr/local/include(*1) -L/usr/local/lib(*1) -lodbc testproc.c -o testproc
Linux 32-bit
gcc -m32 -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.