vendredi 28 août 2015

can't load SQLite extension

#include <sqlite3ext.h>
...
QVariant v = metaDataBase.driver()->handle();
    if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*")==0) {
        sqlite3 *handle = *static_cast<sqlite3 **>(v.data());
        if (handle != 0) {
            int res = sqlite3_enable_load_extension(handle,1);
            if (res == SQLITE_OK) {
                res = sqlite3_load_extension(handle,"libSqliteIcu.so",0,0);
                if (res == SQLITE_OK) qDebug() << "Sqlite3 loaded ICU extension sucessfully";
                else qDebug() <<  "Sqlite3 failed loading ICU extension";}
            else qDebug() << "Sqlite3 failed enabling load extension";}}

and that results in

'sqlite3_api' was not declared in this scope

for the line

res = sqlite3_load_extension(handle,"libSqliteIcu.so",0,0);

how to make it work?

Aucun commentaire:

Enregistrer un commentaire