我试图在用Qt开发的Windows上运行一个简单的SQLITE应用程序。尽管我已经用Qt开发了其他Windows应用程序,但我无法管理它。基本错误是Mobile设备/模拟器找不到SQLITE驱动程序,因为我得到了“未找到驱动程序”错误,下面的代码片段也证明了这一点:
#include <QCoreApplication>
#include <QSqlDatabase>
#include <QStringList>
#include <QtDebug>
int main( int argc, char **argv )
{
QCoreApplication app( argc, argv );
// returns true on mobile platform and false on desktop app.
qDebug() << QSqlDatabase::drivers().empty();
}如果你能回答以下问题,我将不胜感激:
1)在配置Qt时,是否必须指定任何标志才能同时使用SQLITE。这样:配置-qt sqlite?配置-help为这些标志指明了什么:
-qt.在中启用SQL。- plugin启用将SQL作为插件链接到
在运行的时候。可用值: mysql psql oci odbc db2 + sqlitesqlite2 ibase (在此系统上检测到标记为“+”的驱动程序可用)
而这个Windows Ce/Mobile专用的是:
Qt for Windows CE only:
-no-iwmmxt ......... Do not compile with use of IWMMXT instructions
+ -iwmmxt ............ Do compile with use of IWMMXT instructions (Qt for Wind
ows CE on Arm only)
* -no-crt ............ Do not add the C runtime to default deployment rules
-qt-crt ............ Qt identifies C runtime during project generation
-crt <path> ........ Specify path to C runtime used for project generation.
-no-cetest ......... Do not compile Windows CE remote test application
+ -cetest ............ Compile Windows CE remote test application
-signature <file> .. Use file for signing the target project
-opengl-es-cm ...... Enable support for OpenGL ES Common
-opengl-es-cl ...... Enable support for OpenGL ES Common Lite
-opengl-es-2 ....... Enable support for OpenGL ES 2.0
* -phonon-wince-ds9 .. Enable Phonon Direct Show 9 backend for Windows CE2)在部署过程中,我应该添加哪些额外的文件/libs/dll?
谢谢。
发布于 2009-06-26 12:28:43
使用-sql-sqlite重新配置包就足够了,事实上,我输入了配置-platform with 32-with 2005 -xplatform wincewm60professional- msvc2005 -qt sqlite来解决问题。否则,它将使用-plugin-sql-driver标志构建--我不知道为什么这个不能工作。
https://stackoverflow.com/questions/1048379
复制相似问题