Qt QPSQL驱动程序问题 [英] Qt QPSQL driver problem

查看:1060
本文介绍了Qt QPSQL驱动程序问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图连接postgresql与Qt SQL模块。我成功编译psql驱动程序(src \plugins\sqldrivers\psql)。但是当我尝试连接postgresql,我得到这个消息;

I'm trying to connect postgresql with Qt SQL module. I successfully compile psql driver(src\plugins\sqldrivers\psql). But when i try to connect postgresql, i get this message;

QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL3 QMYSQL QODBC3 QODBC QPSQL7 QPSQL



我使用PostgreSQL 8.3,Qt 4.7.1和Visual Studio 2008在Windows XP SP3(我也尝试,但没有帮助)

推荐答案

是否编译了插件的版本和调试版本?依赖关系Walker的输出看起来像是使用调试版本。您应该在%QTDIR%\plugins\sqldrivers目录中有qsqlpsql4.dll和qsqlpsqld4.dll。你可以检查程序中使用的插件路径:QString QLibraryInfo :: location(QLibraryInfo :: PluginsPath);

Did you compile the release and debug versions of the plugin? The output of the dependency walker looks like you work with the debug version. You should have qsqlpsql4.dll and qsqlpsqld4.dll in the %QTDIR%\plugins\sqldrivers directory. You can check the plugin path that is used in your program with: QString QLibraryInfo::location ( QLibraryInfo::PluginsPath );

这篇关于Qt QPSQL驱动程序问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆