Important: Please read the Qt Code of Conduct -

driver not loaded error even after compiling sql plugin for oracle oci.

  • hi to all,
    I have centos6.4 in client and server both, in client installed Qt 5.3.2. After compiling and installing for QOCI plugin as follows:

    #  /opt/Qt5.3.2/5.3/gcc_64/bin/qmake "INCLUDEPATH+=/usr/include/oracle/11.2/client64" "LIBS+=-L/usr/lib/oracle/11.2/client64/lib -lclntsh -lnnz11"
    # make
    # make install

    it works correctly without any error.
    but when i ran this code , it displays "diver not loaded driver not loaded" at run time.
    code is

    #include <QtWidgets>
    #include <QtSql>
    int main(int argc,char* argv[])
        QApplication app(argc,argv);
        QTableView table;
        table.setWindowTitle("QT-Connect to Oracle Database");
        QSqlDatabase db = QSqlDatabase::addDatabase("QOCI");
        if (!
            QMessageBox::critical(0, QObject::tr("Database Error"),
        QSqlQuery query;
        query.exec("select * from v$version");
        QSqlQueryModel model;
        return app.exec();

    and .pro file is :-

    QT       += core gui sql
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    TARGET = oraconnection
    TEMPLATE = app
    SOURCES += main.cpp

    please suggest how to recover "driver not loaded" error

  • Lifetime Qt Champion


    Add the QT_DEBUG_PLUGINS environment variable to the Run part of the Project panel and set it to one.

    It should give you some clue about what is happening.

  • thanks for reply:
    i didn't get your point
    "Add the QT_DEBUG_PLUGINS environment variable to the Run part of the Project panel and set it to one."
    where and how please tell me.

  • Lifetime Qt Champion

    @rahulvishwakarma In QtCreator you go to Projects on the left side, then select the Kit you're using and go to Run, expand the "Run Environment" - here you will see many environment variables, add QT_DEBUG_PLUGINS there...

  • i did as you said but after restarting the system it gives me followong error :-

    This application failed to start because it could not find or load the Qt platform plugin "xcb"
    in "".
    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.
    Reinstalling the application may fix this problem.
    Aborted (core dumped)

    how to solve this

  • Lifetime Qt Champion

    @rahulvishwakarma Does it happen if you start the app from QtCreator?

  • it happens when i start QtCreator

  • Lifetime Qt Champion

    @rahulvishwakarma Search for plugins/platforms/ and do

    ldd PATH_TO/

    and post the output here.

Log in to reply