我按照here描述的步骤为Qt构建了SqlCipher(Mac OSX)。但是,当我尝试使用它时,出现driver not loaded
错误。我的Qt是静态构建的,而不是动态构建的。
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLCIPHER", "config");
db.setDatabaseName(somePath);
if(!db.open()) {
cout << " error opening database! " << endl;
}
QSqlQuery query;
query.exec ("pragma key = 'somepass';");
我收到以下错误:
QSqlDatabase: QSQLCIPHER driver not loaded
QSqlDatabase: available drivers: QSQLITE
QSqlQuery::exec: database not open
QSqlQuery::exec: database not open
QSqlQuery::exec: database not open
QSqlQuery::exec: database not open
error opening database!
可能出现什么问题?