Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSqlDatabase: QOCI driver not loaded QSqlDatabase: available drivers: QSQLITE QPSQL7 QPSQL
Forum Updated to NodeBB v4.3 + New Features

QSqlDatabase: QOCI driver not loaded QSqlDatabase: available drivers: QSQLITE QPSQL7 QPSQL

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 12.6k 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.
  • R Offline
    R Offline
    Romaniy
    wrote on last edited by
    #1

    Hello Everyone,
    as you can see, I have problem with loading libqsqloci.so.

    I compiled this library in Debian 3.9.8-1 x86_64 GNU/Linux with success.
    Now I have this library, but it doesn't work.

    All dependencies present in system, like you can see bellow
    ldd /usr/lib/x86_64-linux-gnu/qt4/plugins/sqldrivers/libqsqloci.so
    linux-vdso.so.1 (0x00007fff5d7fe000)
    libclntsh.so.11.1 => /lib/x86_64-linux-gnu/libclntsh.so.11.1 (0x00007fb3173ae000)
    libQt5Sql.so.5 => /home/roma/qt/qtbase/lib/libQt5Sql.so.5 (0x00007fb317171000)
    libQt5Core.so.5 => /home/roma/qt/qtbase/lib/libQt5Core.so.5 (0x00007fb316a7e000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb316862000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fb31655f000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb316260000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb31604a000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb315c9e000)
    libnnz11.so => /home/oracle/u00/app/oracle/product/11.2.0/dbhome_1/lib/libnnz11.so (0x00007fb3158d5000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb3156d1000)
    libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007fb3154b9000)
    libaio.so.1 => /lib/x86_64-linux-gnu/libaio.so.1 (0x00007fb3152b6000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fb3150ae000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fb319c11000)

    But during debuging my project, I see error message like this
    QSqlDatabase: QOCI driver not loaded
    QSqlDatabase: available drivers: QSQLITE QPSQL7 QPSQL
    DB not open

    But this library defined in
    /usr/lib/x86_64-linux-gnu/qt4/plugins/sqldrivers/
    libqsqlite2.so libqsqlite.so libqsqlmysql.so libqsqloci.so libqsqlodbc.so libqsqlpsql.so libqsqltds.so

    II added in main.cpp this string @qDebug() << app->libraryPaths();@
    for checking enviroment and after compiling this project I saw next:
    ("/usr/lib/x86_64-linux-gnu/qt4/plugins", "/home/roma/Project/build-Astelit_1-Qt_4_8_4_in_PATH_System-Debug")

    In both directories this library is present:
    /home/roma/Project/build-Astelit_1-Qt_4_8_4_in_PATH_System-Debug/libqsqloci.so
    /usr/lib/x86_64-linux-gnu/qt4/plugins/sqldrivers/libqsqloci.so

    Code where I using connection to DB looks like
    @bool MainWindow::createConnection() {
    QSqlDatabase db = QSqlDatabase::addDatabase("QOCI");
    db.setDatabaseName("myDB");
    db.setUserName("roma");
    db.setHostName("localhost");
    db.setPassword("roma");

    if(!db.open()){
        qDebug() << "DB not open";
        return false;
    }
    return true;
    

    }@

    I know, that were several topics with the same title, but I haven't found answer for last several day.
    If somebody need an additional information, i will present it.
    Thank for you help.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      The Oracle run time library is probably not in the run time library path of the program.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Romaniy
        wrote on last edited by
        #3

        Thank for fast responce, ChrisW67,

        bq. The Oracle run time library is probably not in the run time library path of the program.

        If you talk about that $LD_LIBRARY_PATH, I already have had it:
        echo $LD_LIBRARY_PATH
        /home/oracle/u00/app/oracle/product/11.2.0/dbhome_1/lib/

        But problem still exist.
        Waiting for your responce.
        Thank a lot

        1 Reply Last reply
        0
        • R Offline
          R Offline
          Romaniy
          wrote on last edited by
          #4

          I have found the solution.
          My QtCreator worked with using Qt 4.8.4 and I compiled library with Qt 5.1.1.
          So I added new library to QTCreator and now I have new problem.
          But previous problem was solved.

          Thank a lot everybody

          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