如何在Windows中使用Qt访问Postgresql [英] How to access Postgresql using Qt in Windows

查看:171
本文介绍了如何在Windows中使用Qt访问Postgresql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用QtRuby和PostgreSQL开发应用程序。我在Linux上成功开发并成功运行。现在我想在Windows中运行相同的应用程序。但是我无法连接到数据库(PostgreSQL)。我收到以下错误:

I am developing an application using QtRuby and PostgreSQL. I successfully developed and running successfully in Linux. Now i want to run the same application in windows. But I am failing to connect to database(postgresql). I am getting the following errors:

 QSqlDatabase: QPSQL driver not loaded
 QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC


推荐答案

如错误消息所示,QPSQL驱动程序不可用让Qt与Postgres交流。

As the error message says, the QPSQL driver is not available for Qt to talk to Postgres with. Probably the plugin has not been compiled yet.

作为此方法指示,您需要安装PostgreSQL开发人员库,然后手动构建Qt驱动程序插件。有关确切命令,请参见操作方法。

As this how-to indicates, you need to install the PostgreSQL developer libraries, and then manually build the Qt driver plugin. See the how-to for the exact commands.

这篇关于如何在Windows中使用Qt访问Postgresql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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