Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QSqlDatabase: QPSQL driver not loaded
Forum Updated to NodeBB v4.3 + New Features

QSqlDatabase: QPSQL driver not loaded

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 2 Posters 5.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mistu
    wrote on last edited by
    #1

    My setup :

    OS-RHEL 6.1
    QT-Qt Creator 2.4.1
    Based on Qt 4.7.4 (32 bit) installed in /home/CPSS/QtSDK/QtCreator
    Database-Postgres pluse Advanced Server 9.0 installed in \opt\PostgresPlus\9.0AS

    My program:
    dbps.pro file
    @
    QT += core gui
    QT += sql
    TARGET = dbps
    TEMPLATE = app
    SOURCES += main.cpp
    mainwindow.cpp
    HEADERS += mainwindow.h
    FORMS += mainwindow.ui
    @
    mainwindow.cpp

    @#include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include
    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
    if (!db.open())
    {
    qDebug("Database Opening failled\n");
    }
    else
    {
    qDebug("Database Opened\n");
    }
    }
    MainWindow::~MainWindow()
    {

    delete ui;
    }
    @

    My problem:

    when i am running this program ,error comes like this..

    Starting /home/CPSS/Documents/dbps/dbps...
    QSqlDatabase: QPSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE
    Database Opening failled
    /home/CPSS/Documents/dbps/dbps exited with code 0
    I saw qt SQL driver documentation http://doc.qt.nokia.com/4.7-snapshot/sql-driver.html
    and try to solve this problem..

    [CPSS@localhost sqldrivers]$ qmake "INCLUDEPATH+=\opt\PostgresPlus\9.0AS\include" "LIBS+=-L\opt\PostgresPlus\9.0AS\lib -lpq" psql.pro
    Error processing project file: /home/CPSS/QtSDK/QtCreator/lib/qtcreator/plugins/sqldrivers/psql.pro
    As there is no psql folder in my computer so try to do it in sqldrivers folder...then also i face problem as before

    I copied libqsqlpsql.so file in /home/CPSS/QtSDK/QtCreator/lib/qtcreator/plugins/sqldrivers but problem is still there..

    please help me to solve this problem...

    Edit: please use @ tags around code sections; Andre

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Set the QT_DEBUG_PLUGINS environment variable (to 1), and re-run. It should give you more info on what is going on with the loading of plugins.

      See "this video":/videos/watch/the-last-mile-effective-debugging-and-profiling-for-qt-and-qt-quick for more details on debug techniques with Qt.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved