The following information applies for installing libodbc++ on unices.


First, you need to configure libodbc++ for your system. Go into the source directory and do:

$ ./configure
or, if iODBC isn't installed in it's default location /usr/local, do:
$ ./configure --with-iodbc=DIR
This will make ./configure look for iODBC in DIR/include and DIR/lib.

If you aren't using iODBC, try

$ ./configure --with-odbc=DIR
This works the same as above, except it looks for standard ODBC headers and libraries instead of the iODBC-specific ones. This should be used with for example unixODBC and Merant driver manager.

If you wish to install libodbc++ in a location other than /usr/local, add --prefix=PREFIX to the ./configure arguments.

If the c++ compiler you wish to use to compile this package isn't the system default one, you will need to set the environment variable CXX to the name of it's executable. For example, if you have an old gcc or egcs as a system default compiler, but installed a newer gcc in /usr/local/gcc, do like this:

$ CXX=/usr/local/egcs/bin/c++ ./configure --with-iodbc

If you wish to enable support for multithreaded programs, add --enable-threads to the ./configure arguments. On UNIX, this requires pthreads and will probably not yet work on anything else than linux and solaris. The library built will have suffix '-mt' appended to it's name if threads are enabled.

If you wish to enable support for QT, use the --with-qt argument. You can optionally specify where your QT lives by using --with-qt=QTDIR. The --with-qt-includes=DIR, --with-qt-libs=DIR and --with-qt-moc=PATH options might be handy if you have a strange QT installation. This will compile a second version of the library named libodbc++_qt in the subdirectory qt. Note that you must define ODBCXX_QT when compiling a program that links with libodbc++_qt.

The two "demo" programs that come with libodbc++ aren't built by default. To enable them, use --with-isqlxx and/or --with-qtsqlxx to build isql++ respectively qtsql++.

By default, a number of test programs are built with the library. If you do not wish to build them, use --without-tests.

You can control the ODBC version libodbc++ uses by specifying: --with-odbc-version=ODBCVER, where ODBCVER should be a four-digit hexadecimal value representing the ODBC version. For example:

$ ./configure --with-odbc-version=0x0250
would make libodbc++ use ODBC version 2.50.


Just type:

$ make

If it all goes well, you can try a couple of the test programs in tests/. You'll need to configure some datasources before running most of the tests. For simply reality-checking your current ODBC setup, you can try running tests/dmtest, which lists all available datasources and drivers.

Installing libodbc++

If you have write privileges in PREFIX, just do:

$ make install
Otherwise, you'll have to use:
$ su root -c 'make install'