Use the newest SOCI-Library to access SQLite databases

SOCI is a intuitive and fast C++ library to perform database access. Debian provides an outdated package of SOCI Version 2.2. for fast tryouts and tests. But if you want to use discover the real power of SOCI, you will have to use the most recent version 3.0 which isn’t available as Debian (Ubuntu/LinuxMint whatever) -Package.

The recent version of SOCI (3.0) doesn’t include the SQLite back-end engine in the standard deployment, thus is not a official supported and maintained plug-in anymore. Anyway, there is still a SQlite back-end available on the Git Repository of the SOCI project.  This stub will explain, how to obtain, compile and install SOCI 3.0 to replace the orphaned and outdated SOCI 2.0 packages from Debian.

Pleas note, this recipe worked for me, of course there is no guarantee that it works on your system too.

First get the actual SOCI-Resources. If you are handy with git, just execute

$ git clone git://soci.git.sourceforge.net/gitroot/soci

It’s also possible to get an actual snapshot with sourceforge’s web-based git-browser. Just click on the Snapshot Link beneath the most recent entry and you will get a packed archive containing the source. Extract the source somewhere in your home(directory) and open your favourite terminal.

SOCI needs „some“ packages to be aible to build:

$ sudo aptitude install automake libboost-dev libsqlite3-0 libtool

Now everything is prepared and you can roll through the build process. Change into the src/ folder of the downloaded soci code and start build process:

$ ./autogen.sh && ./configure --enable-backend-sqlite3=yes
$ make
$ sudo make install

et voilà. The library files can be found in

/usr/local/lib/libsoci_core-gcc-3_0.so

and

/usr/local/lib/libsoci_sqlite3-gcc-3_0.so

Read on here to learn how to use SOCI and it’s advantages.

Geschrieben in C++,Linux | Kommentare aus

Kommentarfunktion ist deaktiviert

Kommentare sind deaktiviert.