Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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" oci.pro
    # 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");
        db.setHostName("serverora11gr2.db.net");
        db.setDatabaseName("orcl");
        db.setUserName("scott");
        db.setPassword("tiger");
    
        if (!db.open())
        {
            QMessageBox::critical(0, QObject::tr("Database Error"),
            db.lastError().text());
        }
    
        QSqlQuery query;
        query.exec("select * from v$version");
        QSqlQueryModel model;
        model.setQuery(query);
        table.setModel(&model);
        table.resizeColumnsToContents();
        table.resize(450,250);
        table.show();
    
        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

    Hi,

    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/libqxcb.so and do

    ldd PATH_TO/libqxcb.so
    

    and post the output here.


Log in to reply