这是我之前项目遇到的问题,连接postgreSQL数据库,一直找不到引擎,最后终于找到 原因了,需要程序加载

1、安装postgresql客户端,
2、需要配置postgresql客户端的bin和lib路径

3、在程序里面加载

1 QString QSdir = qApp->applicationDirPath();

2 QSdir.append("/sqldrivers");

3 QApplication::addLibraryPath(QSdir); 

4、这里的sqldrivers是个文件名字,可以到QT安装目录的C:\Qt\Qt5.10.1\5.10.1\mingw53_32\plugins找到,里面包含qsqlpsql4.dll和qsqlpsqld4.dll

5、这样就可以加载到postgresql数据库引擎了

相关文章:

  • 2021-09-24
  • 2021-05-24
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
  • 2021-06-29
  • 2021-11-17
  • 2022-03-07
  • 2021-07-05
相关资源
相似解决方案