Compiling the DatabaseLayer source results in a database specific lib file which your project can link to. The name of the static library is in the form libdatabaselayer_<databasebackend>.a on Linux and databaselayer_<databasebackend>.lib on Windows. An example would be libdatabaselayer_firebird.a and databaselayer_firebird.lib as the static libraries generated for the firebird database. Using third party wrapper was avoided so you should only need to link to the native database libraries provided with your selected database (see list below) The "databaselayer/include" directory must be in your project's include path as well as the path.
DatabaseLayer needs the path to the following database-specific header files for each backend that you'd like to compile:
- SQLite
- sqlite3.h
- PostgreSQL
- libpq-fe.h
- Firebird
- ibase.h
- MySQL
- mysql.h
- Oracle (alpha quality support)
- occi.h
You'r project will need to link with the following database-specific library files for each backend that you'd like to compile:
- SQLite
- sqlite3.lib / sqlite3
- PostgreSQL
- libpq.lib / pq
- Firebird
- fbclient.lib / fbclient
- MySQL
- libmysql.lib / mysqlclient (or the output of `mysql_config --libs` on Linux)
- Oracle (alpha quality support)
- oraocci10.lib / ? (Not sure on Linux)
To build a library from DatabaseLayer sources, you can use the makefiles or project files in the BUILD folder.
- MSVC compiler (2 options):
- Use the VC6 project files
nmake -f makefile.vc
- Mingw compiler:
- mingw32-make -f makefile.gcc
- Dev-Cpp:
- Import VC6 project files (detailed instructions can be found here)
- If you have linking errors with the Mingw/Dev-Cpp, try the following steps.
- Make sure that the functions listed in the link errors are in the database library's def file (i.e. libmysql.def)
Generate a mingw-compatible linking library using mingw's dlltool command (i.e. dlltool --input-def libX.def --dllname libX.dll --output-lib libX.a - k)
Link your project to the newly generated libX.a file
So, on Unix-based operating systems, unzip the tar.gz archive and type:
cd build
make -f GNUmakefile (sqlite|postgresql|mysql|firebird|all)
<br/><br/>
Generated on Sat May 13 17:31:38 2006 for databaselayer by
1.4.1