The attached patch should fix this.
WBR, Cyril Roelandt.
--- dballe-5.10.orig/dballe/db/db.cc 2010-11-05 13:42:29.000000000 +0100 +++ dballe-5.10/dballe/db/db.cc 2012-05-19 02:03:31.000000000 +0200 @@ -35,6 +35,7 @@ #include <cstring> #include <cstdlib> #include <cstdio> +#include <unistd.h> #include <sql.h>